// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/contrib/tpu/profiler/tpu_profiler.proto

package tensorflow;

public final class TpuProfiler {
  private TpuProfiler() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistryLite registry) {
  }

  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions(
        (com.google.protobuf.ExtensionRegistryLite) registry);
  }
  public interface ProfileOptionsOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.ProfileOptions)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * We don't collect the dataset ops by default for better trace-viewer
     * scalability. The caller can mannually set this field to include the ops.
     * </pre>
     *
     * <code>bool include_dataset_ops = 1;</code>
     */
    boolean getIncludeDatasetOps();
  }
  /**
   * Protobuf type {@code tensorflow.ProfileOptions}
   */
  public  static final class ProfileOptions extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.ProfileOptions)
      ProfileOptionsOrBuilder {
    // Use ProfileOptions.newBuilder() to construct.
    private ProfileOptions(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private ProfileOptions() {
      includeDatasetOps_ = false;
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
    }
    private ProfileOptions(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      int mutable_bitField0_ = 0;
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!input.skipField(tag)) {
                done = true;
              }
              break;
            }
            case 8: {

              includeDatasetOps_ = input.readBool();
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileOptions_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileOptions_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              tensorflow.TpuProfiler.ProfileOptions.class, tensorflow.TpuProfiler.ProfileOptions.Builder.class);
    }

    public static final int INCLUDE_DATASET_OPS_FIELD_NUMBER = 1;
    private boolean includeDatasetOps_;
    /**
     * <pre>
     * We don't collect the dataset ops by default for better trace-viewer
     * scalability. The caller can mannually set this field to include the ops.
     * </pre>
     *
     * <code>bool include_dataset_ops = 1;</code>
     */
    public boolean getIncludeDatasetOps() {
      return includeDatasetOps_;
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (includeDatasetOps_ != false) {
        output.writeBool(1, includeDatasetOps_);
      }
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (includeDatasetOps_ != false) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(1, includeDatasetOps_);
      }
      memoizedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof tensorflow.TpuProfiler.ProfileOptions)) {
        return super.equals(obj);
      }
      tensorflow.TpuProfiler.ProfileOptions other = (tensorflow.TpuProfiler.ProfileOptions) obj;

      boolean result = true;
      result = result && (getIncludeDatasetOps()
          == other.getIncludeDatasetOps());
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + INCLUDE_DATASET_OPS_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
          getIncludeDatasetOps());
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static tensorflow.TpuProfiler.ProfileOptions parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.TpuProfiler.ProfileOptions parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileOptions parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.TpuProfiler.ProfileOptions parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileOptions parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ProfileOptions parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileOptions parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ProfileOptions parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileOptions parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ProfileOptions parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(tensorflow.TpuProfiler.ProfileOptions prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code tensorflow.ProfileOptions}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.ProfileOptions)
        tensorflow.TpuProfiler.ProfileOptionsOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileOptions_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileOptions_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                tensorflow.TpuProfiler.ProfileOptions.class, tensorflow.TpuProfiler.ProfileOptions.Builder.class);
      }

      // Construct using tensorflow.TpuProfiler.ProfileOptions.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      public Builder clear() {
        super.clear();
        includeDatasetOps_ = false;

        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileOptions_descriptor;
      }

      public tensorflow.TpuProfiler.ProfileOptions getDefaultInstanceForType() {
        return tensorflow.TpuProfiler.ProfileOptions.getDefaultInstance();
      }

      public tensorflow.TpuProfiler.ProfileOptions build() {
        tensorflow.TpuProfiler.ProfileOptions result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public tensorflow.TpuProfiler.ProfileOptions buildPartial() {
        tensorflow.TpuProfiler.ProfileOptions result = new tensorflow.TpuProfiler.ProfileOptions(this);
        result.includeDatasetOps_ = includeDatasetOps_;
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof tensorflow.TpuProfiler.ProfileOptions) {
          return mergeFrom((tensorflow.TpuProfiler.ProfileOptions)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(tensorflow.TpuProfiler.ProfileOptions other) {
        if (other == tensorflow.TpuProfiler.ProfileOptions.getDefaultInstance()) return this;
        if (other.getIncludeDatasetOps() != false) {
          setIncludeDatasetOps(other.getIncludeDatasetOps());
        }
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        tensorflow.TpuProfiler.ProfileOptions parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (tensorflow.TpuProfiler.ProfileOptions) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private boolean includeDatasetOps_ ;
      /**
       * <pre>
       * We don't collect the dataset ops by default for better trace-viewer
       * scalability. The caller can mannually set this field to include the ops.
       * </pre>
       *
       * <code>bool include_dataset_ops = 1;</code>
       */
      public boolean getIncludeDatasetOps() {
        return includeDatasetOps_;
      }
      /**
       * <pre>
       * We don't collect the dataset ops by default for better trace-viewer
       * scalability. The caller can mannually set this field to include the ops.
       * </pre>
       *
       * <code>bool include_dataset_ops = 1;</code>
       */
      public Builder setIncludeDatasetOps(boolean value) {
        
        includeDatasetOps_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * We don't collect the dataset ops by default for better trace-viewer
       * scalability. The caller can mannually set this field to include the ops.
       * </pre>
       *
       * <code>bool include_dataset_ops = 1;</code>
       */
      public Builder clearIncludeDatasetOps() {
        
        includeDatasetOps_ = false;
        onChanged();
        return this;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }

      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }


      // @@protoc_insertion_point(builder_scope:tensorflow.ProfileOptions)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.ProfileOptions)
    private static final tensorflow.TpuProfiler.ProfileOptions DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new tensorflow.TpuProfiler.ProfileOptions();
    }

    public static tensorflow.TpuProfiler.ProfileOptions getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<ProfileOptions>
        PARSER = new com.google.protobuf.AbstractParser<ProfileOptions>() {
      public ProfileOptions parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
          return new ProfileOptions(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<ProfileOptions> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<ProfileOptions> getParserForType() {
      return PARSER;
    }

    public tensorflow.TpuProfiler.ProfileOptions getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface ToolRequestOptionsOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.ToolRequestOptions)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * Required formats for the tool, it should be one of "json", "proto", "raw"
     * etc. If not specified (backward compatible), use default format, i.e. most
     * tools use json format.
     * </pre>
     *
     * <code>string output_formats = 2;</code>
     */
    java.lang.String getOutputFormats();
    /**
     * <pre>
     * Required formats for the tool, it should be one of "json", "proto", "raw"
     * etc. If not specified (backward compatible), use default format, i.e. most
     * tools use json format.
     * </pre>
     *
     * <code>string output_formats = 2;</code>
     */
    com.google.protobuf.ByteString
        getOutputFormatsBytes();

    /**
     * <pre>
     * Whether save the result directly to repository or pass it back to caller.
     * Default to false for backward compatibilities.
     * </pre>
     *
     * <code>bool save_to_repo = 3;</code>
     */
    boolean getSaveToRepo();
  }
  /**
   * Protobuf type {@code tensorflow.ToolRequestOptions}
   */
  public  static final class ToolRequestOptions extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.ToolRequestOptions)
      ToolRequestOptionsOrBuilder {
    // Use ToolRequestOptions.newBuilder() to construct.
    private ToolRequestOptions(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private ToolRequestOptions() {
      outputFormats_ = "";
      saveToRepo_ = false;
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
    }
    private ToolRequestOptions(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      int mutable_bitField0_ = 0;
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!input.skipField(tag)) {
                done = true;
              }
              break;
            }
            case 18: {
              java.lang.String s = input.readStringRequireUtf8();

              outputFormats_ = s;
              break;
            }
            case 24: {

              saveToRepo_ = input.readBool();
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return tensorflow.TpuProfiler.internal_static_tensorflow_ToolRequestOptions_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return tensorflow.TpuProfiler.internal_static_tensorflow_ToolRequestOptions_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              tensorflow.TpuProfiler.ToolRequestOptions.class, tensorflow.TpuProfiler.ToolRequestOptions.Builder.class);
    }

    public static final int OUTPUT_FORMATS_FIELD_NUMBER = 2;
    private volatile java.lang.Object outputFormats_;
    /**
     * <pre>
     * Required formats for the tool, it should be one of "json", "proto", "raw"
     * etc. If not specified (backward compatible), use default format, i.e. most
     * tools use json format.
     * </pre>
     *
     * <code>string output_formats = 2;</code>
     */
    public java.lang.String getOutputFormats() {
      java.lang.Object ref = outputFormats_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        outputFormats_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * Required formats for the tool, it should be one of "json", "proto", "raw"
     * etc. If not specified (backward compatible), use default format, i.e. most
     * tools use json format.
     * </pre>
     *
     * <code>string output_formats = 2;</code>
     */
    public com.google.protobuf.ByteString
        getOutputFormatsBytes() {
      java.lang.Object ref = outputFormats_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        outputFormats_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int SAVE_TO_REPO_FIELD_NUMBER = 3;
    private boolean saveToRepo_;
    /**
     * <pre>
     * Whether save the result directly to repository or pass it back to caller.
     * Default to false for backward compatibilities.
     * </pre>
     *
     * <code>bool save_to_repo = 3;</code>
     */
    public boolean getSaveToRepo() {
      return saveToRepo_;
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!getOutputFormatsBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 2, outputFormats_);
      }
      if (saveToRepo_ != false) {
        output.writeBool(3, saveToRepo_);
      }
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!getOutputFormatsBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, outputFormats_);
      }
      if (saveToRepo_ != false) {
        size += com.google.protobuf.CodedOutputStream
          .computeBoolSize(3, saveToRepo_);
      }
      memoizedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof tensorflow.TpuProfiler.ToolRequestOptions)) {
        return super.equals(obj);
      }
      tensorflow.TpuProfiler.ToolRequestOptions other = (tensorflow.TpuProfiler.ToolRequestOptions) obj;

      boolean result = true;
      result = result && getOutputFormats()
          .equals(other.getOutputFormats());
      result = result && (getSaveToRepo()
          == other.getSaveToRepo());
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + OUTPUT_FORMATS_FIELD_NUMBER;
      hash = (53 * hash) + getOutputFormats().hashCode();
      hash = (37 * hash) + SAVE_TO_REPO_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
          getSaveToRepo());
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static tensorflow.TpuProfiler.ToolRequestOptions parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.TpuProfiler.ToolRequestOptions parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ToolRequestOptions parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.TpuProfiler.ToolRequestOptions parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ToolRequestOptions parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ToolRequestOptions parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ToolRequestOptions parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ToolRequestOptions parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ToolRequestOptions parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ToolRequestOptions parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(tensorflow.TpuProfiler.ToolRequestOptions prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code tensorflow.ToolRequestOptions}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.ToolRequestOptions)
        tensorflow.TpuProfiler.ToolRequestOptionsOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ToolRequestOptions_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ToolRequestOptions_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                tensorflow.TpuProfiler.ToolRequestOptions.class, tensorflow.TpuProfiler.ToolRequestOptions.Builder.class);
      }

      // Construct using tensorflow.TpuProfiler.ToolRequestOptions.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      public Builder clear() {
        super.clear();
        outputFormats_ = "";

        saveToRepo_ = false;

        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ToolRequestOptions_descriptor;
      }

      public tensorflow.TpuProfiler.ToolRequestOptions getDefaultInstanceForType() {
        return tensorflow.TpuProfiler.ToolRequestOptions.getDefaultInstance();
      }

      public tensorflow.TpuProfiler.ToolRequestOptions build() {
        tensorflow.TpuProfiler.ToolRequestOptions result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public tensorflow.TpuProfiler.ToolRequestOptions buildPartial() {
        tensorflow.TpuProfiler.ToolRequestOptions result = new tensorflow.TpuProfiler.ToolRequestOptions(this);
        result.outputFormats_ = outputFormats_;
        result.saveToRepo_ = saveToRepo_;
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof tensorflow.TpuProfiler.ToolRequestOptions) {
          return mergeFrom((tensorflow.TpuProfiler.ToolRequestOptions)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(tensorflow.TpuProfiler.ToolRequestOptions other) {
        if (other == tensorflow.TpuProfiler.ToolRequestOptions.getDefaultInstance()) return this;
        if (!other.getOutputFormats().isEmpty()) {
          outputFormats_ = other.outputFormats_;
          onChanged();
        }
        if (other.getSaveToRepo() != false) {
          setSaveToRepo(other.getSaveToRepo());
        }
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        tensorflow.TpuProfiler.ToolRequestOptions parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (tensorflow.TpuProfiler.ToolRequestOptions) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private java.lang.Object outputFormats_ = "";
      /**
       * <pre>
       * Required formats for the tool, it should be one of "json", "proto", "raw"
       * etc. If not specified (backward compatible), use default format, i.e. most
       * tools use json format.
       * </pre>
       *
       * <code>string output_formats = 2;</code>
       */
      public java.lang.String getOutputFormats() {
        java.lang.Object ref = outputFormats_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          outputFormats_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * Required formats for the tool, it should be one of "json", "proto", "raw"
       * etc. If not specified (backward compatible), use default format, i.e. most
       * tools use json format.
       * </pre>
       *
       * <code>string output_formats = 2;</code>
       */
      public com.google.protobuf.ByteString
          getOutputFormatsBytes() {
        java.lang.Object ref = outputFormats_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          outputFormats_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * Required formats for the tool, it should be one of "json", "proto", "raw"
       * etc. If not specified (backward compatible), use default format, i.e. most
       * tools use json format.
       * </pre>
       *
       * <code>string output_formats = 2;</code>
       */
      public Builder setOutputFormats(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        outputFormats_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Required formats for the tool, it should be one of "json", "proto", "raw"
       * etc. If not specified (backward compatible), use default format, i.e. most
       * tools use json format.
       * </pre>
       *
       * <code>string output_formats = 2;</code>
       */
      public Builder clearOutputFormats() {
        
        outputFormats_ = getDefaultInstance().getOutputFormats();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Required formats for the tool, it should be one of "json", "proto", "raw"
       * etc. If not specified (backward compatible), use default format, i.e. most
       * tools use json format.
       * </pre>
       *
       * <code>string output_formats = 2;</code>
       */
      public Builder setOutputFormatsBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        outputFormats_ = value;
        onChanged();
        return this;
      }

      private boolean saveToRepo_ ;
      /**
       * <pre>
       * Whether save the result directly to repository or pass it back to caller.
       * Default to false for backward compatibilities.
       * </pre>
       *
       * <code>bool save_to_repo = 3;</code>
       */
      public boolean getSaveToRepo() {
        return saveToRepo_;
      }
      /**
       * <pre>
       * Whether save the result directly to repository or pass it back to caller.
       * Default to false for backward compatibilities.
       * </pre>
       *
       * <code>bool save_to_repo = 3;</code>
       */
      public Builder setSaveToRepo(boolean value) {
        
        saveToRepo_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Whether save the result directly to repository or pass it back to caller.
       * Default to false for backward compatibilities.
       * </pre>
       *
       * <code>bool save_to_repo = 3;</code>
       */
      public Builder clearSaveToRepo() {
        
        saveToRepo_ = false;
        onChanged();
        return this;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }

      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }


      // @@protoc_insertion_point(builder_scope:tensorflow.ToolRequestOptions)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.ToolRequestOptions)
    private static final tensorflow.TpuProfiler.ToolRequestOptions DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new tensorflow.TpuProfiler.ToolRequestOptions();
    }

    public static tensorflow.TpuProfiler.ToolRequestOptions getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<ToolRequestOptions>
        PARSER = new com.google.protobuf.AbstractParser<ToolRequestOptions>() {
      public ToolRequestOptions parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
          return new ToolRequestOptions(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<ToolRequestOptions> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<ToolRequestOptions> getParserForType() {
      return PARSER;
    }

    public tensorflow.TpuProfiler.ToolRequestOptions getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface ProfileRequestOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.ProfileRequest)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * In future, the caller will be able to customize when profiling starts and
     * stops. For now, it collects `duration_ms` milliseconds worth of data.
     * </pre>
     *
     * <code>uint64 duration_ms = 1;</code>
     */
    long getDurationMs();

    /**
     * <pre>
     * The maximum number of events to return. By default (value 0), return all
     * events.
     * </pre>
     *
     * <code>uint64 max_events = 2;</code>
     */
    long getMaxEvents();

    /**
     * <pre>
     * Required profiling tools name such as "input_pipeline_analyzer" etc
     * </pre>
     *
     * <code>repeated string tools = 3;</code>
     */
    java.util.List<java.lang.String>
        getToolsList();
    /**
     * <pre>
     * Required profiling tools name such as "input_pipeline_analyzer" etc
     * </pre>
     *
     * <code>repeated string tools = 3;</code>
     */
    int getToolsCount();
    /**
     * <pre>
     * Required profiling tools name such as "input_pipeline_analyzer" etc
     * </pre>
     *
     * <code>repeated string tools = 3;</code>
     */
    java.lang.String getTools(int index);
    /**
     * <pre>
     * Required profiling tools name such as "input_pipeline_analyzer" etc
     * </pre>
     *
     * <code>repeated string tools = 3;</code>
     */
    com.google.protobuf.ByteString
        getToolsBytes(int index);

    /**
     * <pre>
     * Specifies the requirement for each tools.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
     */
    int getToolOptionsCount();
    /**
     * <pre>
     * Specifies the requirement for each tools.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
     */
    boolean containsToolOptions(
        java.lang.String key);
    /**
     * Use {@link #getToolOptionsMap()} instead.
     */
    @java.lang.Deprecated
    java.util.Map<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions>
    getToolOptions();
    /**
     * <pre>
     * Specifies the requirement for each tools.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
     */
    java.util.Map<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions>
    getToolOptionsMap();
    /**
     * <pre>
     * Specifies the requirement for each tools.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
     */

    tensorflow.TpuProfiler.ToolRequestOptions getToolOptionsOrDefault(
        java.lang.String key,
        tensorflow.TpuProfiler.ToolRequestOptions defaultValue);
    /**
     * <pre>
     * Specifies the requirement for each tools.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
     */

    tensorflow.TpuProfiler.ToolRequestOptions getToolOptionsOrThrow(
        java.lang.String key);

    /**
     * <pre>
     * Optional profiling options that control how a TF session will be profiled.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions opts = 4;</code>
     */
    boolean hasOpts();
    /**
     * <pre>
     * Optional profiling options that control how a TF session will be profiled.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions opts = 4;</code>
     */
    tensorflow.TpuProfiler.ProfileOptions getOpts();
    /**
     * <pre>
     * Optional profiling options that control how a TF session will be profiled.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions opts = 4;</code>
     */
    tensorflow.TpuProfiler.ProfileOptionsOrBuilder getOptsOrBuilder();

    /**
     * <pre>
     * The place where we will dump profile data. We will normally use
     * MODEL_DIR/plugin/profile/ as our repository root.
     * </pre>
     *
     * <code>string repository_root = 5;</code>
     */
    java.lang.String getRepositoryRoot();
    /**
     * <pre>
     * The place where we will dump profile data. We will normally use
     * MODEL_DIR/plugin/profile/ as our repository root.
     * </pre>
     *
     * <code>string repository_root = 5;</code>
     */
    com.google.protobuf.ByteString
        getRepositoryRootBytes();

    /**
     * <pre>
     * The user provided profile session identifier.
     * </pre>
     *
     * <code>string session_id = 6;</code>
     */
    java.lang.String getSessionId();
    /**
     * <pre>
     * The user provided profile session identifier.
     * </pre>
     *
     * <code>string session_id = 6;</code>
     */
    com.google.protobuf.ByteString
        getSessionIdBytes();

    /**
     * <pre>
     * The hostname of system where the profile should happen.
     * We use it as identifier in part of our output filename.
     * </pre>
     *
     * <code>string host_name = 7;</code>
     */
    java.lang.String getHostName();
    /**
     * <pre>
     * The hostname of system where the profile should happen.
     * We use it as identifier in part of our output filename.
     * </pre>
     *
     * <code>string host_name = 7;</code>
     */
    com.google.protobuf.ByteString
        getHostNameBytes();
  }
  /**
   * Protobuf type {@code tensorflow.ProfileRequest}
   */
  public  static final class ProfileRequest extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.ProfileRequest)
      ProfileRequestOrBuilder {
    // Use ProfileRequest.newBuilder() to construct.
    private ProfileRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private ProfileRequest() {
      durationMs_ = 0L;
      maxEvents_ = 0L;
      tools_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      repositoryRoot_ = "";
      sessionId_ = "";
      hostName_ = "";
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
    }
    private ProfileRequest(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      int mutable_bitField0_ = 0;
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!input.skipField(tag)) {
                done = true;
              }
              break;
            }
            case 8: {

              durationMs_ = input.readUInt64();
              break;
            }
            case 16: {

              maxEvents_ = input.readUInt64();
              break;
            }
            case 26: {
              java.lang.String s = input.readStringRequireUtf8();
              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
                tools_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000004;
              }
              tools_.add(s);
              break;
            }
            case 34: {
              tensorflow.TpuProfiler.ProfileOptions.Builder subBuilder = null;
              if (opts_ != null) {
                subBuilder = opts_.toBuilder();
              }
              opts_ = input.readMessage(tensorflow.TpuProfiler.ProfileOptions.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(opts_);
                opts_ = subBuilder.buildPartial();
              }

              break;
            }
            case 42: {
              java.lang.String s = input.readStringRequireUtf8();

              repositoryRoot_ = s;
              break;
            }
            case 50: {
              java.lang.String s = input.readStringRequireUtf8();

              sessionId_ = s;
              break;
            }
            case 58: {
              java.lang.String s = input.readStringRequireUtf8();

              hostName_ = s;
              break;
            }
            case 66: {
              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
                toolOptions_ = com.google.protobuf.MapField.newMapField(
                    ToolOptionsDefaultEntryHolder.defaultEntry);
                mutable_bitField0_ |= 0x00000008;
              }
              com.google.protobuf.MapEntry<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions>
              toolOptions__ = input.readMessage(
                  ToolOptionsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
              toolOptions_.getMutableMap().put(
                  toolOptions__.getKey(), toolOptions__.getValue());
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
          tools_ = tools_.getUnmodifiableView();
        }
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileRequest_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 8:
          return internalGetToolOptions();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileRequest_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              tensorflow.TpuProfiler.ProfileRequest.class, tensorflow.TpuProfiler.ProfileRequest.Builder.class);
    }

    private int bitField0_;
    public static final int DURATION_MS_FIELD_NUMBER = 1;
    private long durationMs_;
    /**
     * <pre>
     * In future, the caller will be able to customize when profiling starts and
     * stops. For now, it collects `duration_ms` milliseconds worth of data.
     * </pre>
     *
     * <code>uint64 duration_ms = 1;</code>
     */
    public long getDurationMs() {
      return durationMs_;
    }

    public static final int MAX_EVENTS_FIELD_NUMBER = 2;
    private long maxEvents_;
    /**
     * <pre>
     * The maximum number of events to return. By default (value 0), return all
     * events.
     * </pre>
     *
     * <code>uint64 max_events = 2;</code>
     */
    public long getMaxEvents() {
      return maxEvents_;
    }

    public static final int TOOLS_FIELD_NUMBER = 3;
    private com.google.protobuf.LazyStringList tools_;
    /**
     * <pre>
     * Required profiling tools name such as "input_pipeline_analyzer" etc
     * </pre>
     *
     * <code>repeated string tools = 3;</code>
     */
    public com.google.protobuf.ProtocolStringList
        getToolsList() {
      return tools_;
    }
    /**
     * <pre>
     * Required profiling tools name such as "input_pipeline_analyzer" etc
     * </pre>
     *
     * <code>repeated string tools = 3;</code>
     */
    public int getToolsCount() {
      return tools_.size();
    }
    /**
     * <pre>
     * Required profiling tools name such as "input_pipeline_analyzer" etc
     * </pre>
     *
     * <code>repeated string tools = 3;</code>
     */
    public java.lang.String getTools(int index) {
      return tools_.get(index);
    }
    /**
     * <pre>
     * Required profiling tools name such as "input_pipeline_analyzer" etc
     * </pre>
     *
     * <code>repeated string tools = 3;</code>
     */
    public com.google.protobuf.ByteString
        getToolsBytes(int index) {
      return tools_.getByteString(index);
    }

    public static final int TOOL_OPTIONS_FIELD_NUMBER = 8;
    private static final class ToolOptionsDefaultEntryHolder {
      static final com.google.protobuf.MapEntry<
          java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> defaultEntry =
              com.google.protobuf.MapEntry
              .<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions>newDefaultInstance(
                  tensorflow.TpuProfiler.internal_static_tensorflow_ProfileRequest_ToolOptionsEntry_descriptor, 
                  com.google.protobuf.WireFormat.FieldType.STRING,
                  "",
                  com.google.protobuf.WireFormat.FieldType.MESSAGE,
                  tensorflow.TpuProfiler.ToolRequestOptions.getDefaultInstance());
    }
    private com.google.protobuf.MapField<
        java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> toolOptions_;
    private com.google.protobuf.MapField<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions>
    internalGetToolOptions() {
      if (toolOptions_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            ToolOptionsDefaultEntryHolder.defaultEntry);
      }
      return toolOptions_;
    }

    public int getToolOptionsCount() {
      return internalGetToolOptions().getMap().size();
    }
    /**
     * <pre>
     * Specifies the requirement for each tools.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
     */

    public boolean containsToolOptions(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      return internalGetToolOptions().getMap().containsKey(key);
    }
    /**
     * Use {@link #getToolOptionsMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> getToolOptions() {
      return getToolOptionsMap();
    }
    /**
     * <pre>
     * Specifies the requirement for each tools.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
     */

    public java.util.Map<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> getToolOptionsMap() {
      return internalGetToolOptions().getMap();
    }
    /**
     * <pre>
     * Specifies the requirement for each tools.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
     */

    public tensorflow.TpuProfiler.ToolRequestOptions getToolOptionsOrDefault(
        java.lang.String key,
        tensorflow.TpuProfiler.ToolRequestOptions defaultValue) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> map =
          internalGetToolOptions().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * Specifies the requirement for each tools.
     * </pre>
     *
     * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
     */

    public tensorflow.TpuProfiler.ToolRequestOptions getToolOptionsOrThrow(
        java.lang.String key) {
      if (key == null) { throw new java.lang.NullPointerException(); }
      java.util.Map<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> map =
          internalGetToolOptions().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public static final int OPTS_FIELD_NUMBER = 4;
    private tensorflow.TpuProfiler.ProfileOptions opts_;
    /**
     * <pre>
     * Optional profiling options that control how a TF session will be profiled.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions opts = 4;</code>
     */
    public boolean hasOpts() {
      return opts_ != null;
    }
    /**
     * <pre>
     * Optional profiling options that control how a TF session will be profiled.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions opts = 4;</code>
     */
    public tensorflow.TpuProfiler.ProfileOptions getOpts() {
      return opts_ == null ? tensorflow.TpuProfiler.ProfileOptions.getDefaultInstance() : opts_;
    }
    /**
     * <pre>
     * Optional profiling options that control how a TF session will be profiled.
     * </pre>
     *
     * <code>.tensorflow.ProfileOptions opts = 4;</code>
     */
    public tensorflow.TpuProfiler.ProfileOptionsOrBuilder getOptsOrBuilder() {
      return getOpts();
    }

    public static final int REPOSITORY_ROOT_FIELD_NUMBER = 5;
    private volatile java.lang.Object repositoryRoot_;
    /**
     * <pre>
     * The place where we will dump profile data. We will normally use
     * MODEL_DIR/plugin/profile/ as our repository root.
     * </pre>
     *
     * <code>string repository_root = 5;</code>
     */
    public java.lang.String getRepositoryRoot() {
      java.lang.Object ref = repositoryRoot_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        repositoryRoot_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The place where we will dump profile data. We will normally use
     * MODEL_DIR/plugin/profile/ as our repository root.
     * </pre>
     *
     * <code>string repository_root = 5;</code>
     */
    public com.google.protobuf.ByteString
        getRepositoryRootBytes() {
      java.lang.Object ref = repositoryRoot_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        repositoryRoot_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int SESSION_ID_FIELD_NUMBER = 6;
    private volatile java.lang.Object sessionId_;
    /**
     * <pre>
     * The user provided profile session identifier.
     * </pre>
     *
     * <code>string session_id = 6;</code>
     */
    public java.lang.String getSessionId() {
      java.lang.Object ref = sessionId_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        sessionId_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The user provided profile session identifier.
     * </pre>
     *
     * <code>string session_id = 6;</code>
     */
    public com.google.protobuf.ByteString
        getSessionIdBytes() {
      java.lang.Object ref = sessionId_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        sessionId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int HOST_NAME_FIELD_NUMBER = 7;
    private volatile java.lang.Object hostName_;
    /**
     * <pre>
     * The hostname of system where the profile should happen.
     * We use it as identifier in part of our output filename.
     * </pre>
     *
     * <code>string host_name = 7;</code>
     */
    public java.lang.String getHostName() {
      java.lang.Object ref = hostName_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        hostName_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The hostname of system where the profile should happen.
     * We use it as identifier in part of our output filename.
     * </pre>
     *
     * <code>string host_name = 7;</code>
     */
    public com.google.protobuf.ByteString
        getHostNameBytes() {
      java.lang.Object ref = hostName_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        hostName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (durationMs_ != 0L) {
        output.writeUInt64(1, durationMs_);
      }
      if (maxEvents_ != 0L) {
        output.writeUInt64(2, maxEvents_);
      }
      for (int i = 0; i < tools_.size(); i++) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 3, tools_.getRaw(i));
      }
      if (opts_ != null) {
        output.writeMessage(4, getOpts());
      }
      if (!getRepositoryRootBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 5, repositoryRoot_);
      }
      if (!getSessionIdBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 6, sessionId_);
      }
      if (!getHostNameBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 7, hostName_);
      }
      com.google.protobuf.GeneratedMessageV3
        .serializeStringMapTo(
          output,
          internalGetToolOptions(),
          ToolOptionsDefaultEntryHolder.defaultEntry,
          8);
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (durationMs_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeUInt64Size(1, durationMs_);
      }
      if (maxEvents_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeUInt64Size(2, maxEvents_);
      }
      {
        int dataSize = 0;
        for (int i = 0; i < tools_.size(); i++) {
          dataSize += computeStringSizeNoTag(tools_.getRaw(i));
        }
        size += dataSize;
        size += 1 * getToolsList().size();
      }
      if (opts_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(4, getOpts());
      }
      if (!getRepositoryRootBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, repositoryRoot_);
      }
      if (!getSessionIdBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, sessionId_);
      }
      if (!getHostNameBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, hostName_);
      }
      for (java.util.Map.Entry<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> entry
           : internalGetToolOptions().getMap().entrySet()) {
        com.google.protobuf.MapEntry<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions>
        toolOptions__ = ToolOptionsDefaultEntryHolder.defaultEntry.newBuilderForType()
            .setKey(entry.getKey())
            .setValue(entry.getValue())
            .build();
        size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(8, toolOptions__);
      }
      memoizedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof tensorflow.TpuProfiler.ProfileRequest)) {
        return super.equals(obj);
      }
      tensorflow.TpuProfiler.ProfileRequest other = (tensorflow.TpuProfiler.ProfileRequest) obj;

      boolean result = true;
      result = result && (getDurationMs()
          == other.getDurationMs());
      result = result && (getMaxEvents()
          == other.getMaxEvents());
      result = result && getToolsList()
          .equals(other.getToolsList());
      result = result && internalGetToolOptions().equals(
          other.internalGetToolOptions());
      result = result && (hasOpts() == other.hasOpts());
      if (hasOpts()) {
        result = result && getOpts()
            .equals(other.getOpts());
      }
      result = result && getRepositoryRoot()
          .equals(other.getRepositoryRoot());
      result = result && getSessionId()
          .equals(other.getSessionId());
      result = result && getHostName()
          .equals(other.getHostName());
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + DURATION_MS_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getDurationMs());
      hash = (37 * hash) + MAX_EVENTS_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getMaxEvents());
      if (getToolsCount() > 0) {
        hash = (37 * hash) + TOOLS_FIELD_NUMBER;
        hash = (53 * hash) + getToolsList().hashCode();
      }
      if (!internalGetToolOptions().getMap().isEmpty()) {
        hash = (37 * hash) + TOOL_OPTIONS_FIELD_NUMBER;
        hash = (53 * hash) + internalGetToolOptions().hashCode();
      }
      if (hasOpts()) {
        hash = (37 * hash) + OPTS_FIELD_NUMBER;
        hash = (53 * hash) + getOpts().hashCode();
      }
      hash = (37 * hash) + REPOSITORY_ROOT_FIELD_NUMBER;
      hash = (53 * hash) + getRepositoryRoot().hashCode();
      hash = (37 * hash) + SESSION_ID_FIELD_NUMBER;
      hash = (53 * hash) + getSessionId().hashCode();
      hash = (37 * hash) + HOST_NAME_FIELD_NUMBER;
      hash = (53 * hash) + getHostName().hashCode();
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static tensorflow.TpuProfiler.ProfileRequest parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.TpuProfiler.ProfileRequest parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileRequest parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.TpuProfiler.ProfileRequest parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileRequest parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ProfileRequest parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileRequest parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ProfileRequest parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileRequest parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ProfileRequest parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(tensorflow.TpuProfiler.ProfileRequest prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code tensorflow.ProfileRequest}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.ProfileRequest)
        tensorflow.TpuProfiler.ProfileRequestOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileRequest_descriptor;
      }

      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMapField(
          int number) {
        switch (number) {
          case 8:
            return internalGetToolOptions();
          default:
            throw new RuntimeException(
                "Invalid map field number: " + number);
        }
      }
      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMutableMapField(
          int number) {
        switch (number) {
          case 8:
            return internalGetMutableToolOptions();
          default:
            throw new RuntimeException(
                "Invalid map field number: " + number);
        }
      }
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileRequest_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                tensorflow.TpuProfiler.ProfileRequest.class, tensorflow.TpuProfiler.ProfileRequest.Builder.class);
      }

      // Construct using tensorflow.TpuProfiler.ProfileRequest.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      public Builder clear() {
        super.clear();
        durationMs_ = 0L;

        maxEvents_ = 0L;

        tools_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000004);
        internalGetMutableToolOptions().clear();
        if (optsBuilder_ == null) {
          opts_ = null;
        } else {
          opts_ = null;
          optsBuilder_ = null;
        }
        repositoryRoot_ = "";

        sessionId_ = "";

        hostName_ = "";

        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileRequest_descriptor;
      }

      public tensorflow.TpuProfiler.ProfileRequest getDefaultInstanceForType() {
        return tensorflow.TpuProfiler.ProfileRequest.getDefaultInstance();
      }

      public tensorflow.TpuProfiler.ProfileRequest build() {
        tensorflow.TpuProfiler.ProfileRequest result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public tensorflow.TpuProfiler.ProfileRequest buildPartial() {
        tensorflow.TpuProfiler.ProfileRequest result = new tensorflow.TpuProfiler.ProfileRequest(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        result.durationMs_ = durationMs_;
        result.maxEvents_ = maxEvents_;
        if (((bitField0_ & 0x00000004) == 0x00000004)) {
          tools_ = tools_.getUnmodifiableView();
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.tools_ = tools_;
        result.toolOptions_ = internalGetToolOptions();
        result.toolOptions_.makeImmutable();
        if (optsBuilder_ == null) {
          result.opts_ = opts_;
        } else {
          result.opts_ = optsBuilder_.build();
        }
        result.repositoryRoot_ = repositoryRoot_;
        result.sessionId_ = sessionId_;
        result.hostName_ = hostName_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof tensorflow.TpuProfiler.ProfileRequest) {
          return mergeFrom((tensorflow.TpuProfiler.ProfileRequest)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(tensorflow.TpuProfiler.ProfileRequest other) {
        if (other == tensorflow.TpuProfiler.ProfileRequest.getDefaultInstance()) return this;
        if (other.getDurationMs() != 0L) {
          setDurationMs(other.getDurationMs());
        }
        if (other.getMaxEvents() != 0L) {
          setMaxEvents(other.getMaxEvents());
        }
        if (!other.tools_.isEmpty()) {
          if (tools_.isEmpty()) {
            tools_ = other.tools_;
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            ensureToolsIsMutable();
            tools_.addAll(other.tools_);
          }
          onChanged();
        }
        internalGetMutableToolOptions().mergeFrom(
            other.internalGetToolOptions());
        if (other.hasOpts()) {
          mergeOpts(other.getOpts());
        }
        if (!other.getRepositoryRoot().isEmpty()) {
          repositoryRoot_ = other.repositoryRoot_;
          onChanged();
        }
        if (!other.getSessionId().isEmpty()) {
          sessionId_ = other.sessionId_;
          onChanged();
        }
        if (!other.getHostName().isEmpty()) {
          hostName_ = other.hostName_;
          onChanged();
        }
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        tensorflow.TpuProfiler.ProfileRequest parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (tensorflow.TpuProfiler.ProfileRequest) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      private long durationMs_ ;
      /**
       * <pre>
       * In future, the caller will be able to customize when profiling starts and
       * stops. For now, it collects `duration_ms` milliseconds worth of data.
       * </pre>
       *
       * <code>uint64 duration_ms = 1;</code>
       */
      public long getDurationMs() {
        return durationMs_;
      }
      /**
       * <pre>
       * In future, the caller will be able to customize when profiling starts and
       * stops. For now, it collects `duration_ms` milliseconds worth of data.
       * </pre>
       *
       * <code>uint64 duration_ms = 1;</code>
       */
      public Builder setDurationMs(long value) {
        
        durationMs_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * In future, the caller will be able to customize when profiling starts and
       * stops. For now, it collects `duration_ms` milliseconds worth of data.
       * </pre>
       *
       * <code>uint64 duration_ms = 1;</code>
       */
      public Builder clearDurationMs() {
        
        durationMs_ = 0L;
        onChanged();
        return this;
      }

      private long maxEvents_ ;
      /**
       * <pre>
       * The maximum number of events to return. By default (value 0), return all
       * events.
       * </pre>
       *
       * <code>uint64 max_events = 2;</code>
       */
      public long getMaxEvents() {
        return maxEvents_;
      }
      /**
       * <pre>
       * The maximum number of events to return. By default (value 0), return all
       * events.
       * </pre>
       *
       * <code>uint64 max_events = 2;</code>
       */
      public Builder setMaxEvents(long value) {
        
        maxEvents_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The maximum number of events to return. By default (value 0), return all
       * events.
       * </pre>
       *
       * <code>uint64 max_events = 2;</code>
       */
      public Builder clearMaxEvents() {
        
        maxEvents_ = 0L;
        onChanged();
        return this;
      }

      private com.google.protobuf.LazyStringList tools_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      private void ensureToolsIsMutable() {
        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
          tools_ = new com.google.protobuf.LazyStringArrayList(tools_);
          bitField0_ |= 0x00000004;
         }
      }
      /**
       * <pre>
       * Required profiling tools name such as "input_pipeline_analyzer" etc
       * </pre>
       *
       * <code>repeated string tools = 3;</code>
       */
      public com.google.protobuf.ProtocolStringList
          getToolsList() {
        return tools_.getUnmodifiableView();
      }
      /**
       * <pre>
       * Required profiling tools name such as "input_pipeline_analyzer" etc
       * </pre>
       *
       * <code>repeated string tools = 3;</code>
       */
      public int getToolsCount() {
        return tools_.size();
      }
      /**
       * <pre>
       * Required profiling tools name such as "input_pipeline_analyzer" etc
       * </pre>
       *
       * <code>repeated string tools = 3;</code>
       */
      public java.lang.String getTools(int index) {
        return tools_.get(index);
      }
      /**
       * <pre>
       * Required profiling tools name such as "input_pipeline_analyzer" etc
       * </pre>
       *
       * <code>repeated string tools = 3;</code>
       */
      public com.google.protobuf.ByteString
          getToolsBytes(int index) {
        return tools_.getByteString(index);
      }
      /**
       * <pre>
       * Required profiling tools name such as "input_pipeline_analyzer" etc
       * </pre>
       *
       * <code>repeated string tools = 3;</code>
       */
      public Builder setTools(
          int index, java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureToolsIsMutable();
        tools_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Required profiling tools name such as "input_pipeline_analyzer" etc
       * </pre>
       *
       * <code>repeated string tools = 3;</code>
       */
      public Builder addTools(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureToolsIsMutable();
        tools_.add(value);
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Required profiling tools name such as "input_pipeline_analyzer" etc
       * </pre>
       *
       * <code>repeated string tools = 3;</code>
       */
      public Builder addAllTools(
          java.lang.Iterable<java.lang.String> values) {
        ensureToolsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, tools_);
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Required profiling tools name such as "input_pipeline_analyzer" etc
       * </pre>
       *
       * <code>repeated string tools = 3;</code>
       */
      public Builder clearTools() {
        tools_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Required profiling tools name such as "input_pipeline_analyzer" etc
       * </pre>
       *
       * <code>repeated string tools = 3;</code>
       */
      public Builder addToolsBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        ensureToolsIsMutable();
        tools_.add(value);
        onChanged();
        return this;
      }

      private com.google.protobuf.MapField<
          java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> toolOptions_;
      private com.google.protobuf.MapField<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions>
      internalGetToolOptions() {
        if (toolOptions_ == null) {
          return com.google.protobuf.MapField.emptyMapField(
              ToolOptionsDefaultEntryHolder.defaultEntry);
        }
        return toolOptions_;
      }
      private com.google.protobuf.MapField<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions>
      internalGetMutableToolOptions() {
        onChanged();;
        if (toolOptions_ == null) {
          toolOptions_ = com.google.protobuf.MapField.newMapField(
              ToolOptionsDefaultEntryHolder.defaultEntry);
        }
        if (!toolOptions_.isMutable()) {
          toolOptions_ = toolOptions_.copy();
        }
        return toolOptions_;
      }

      public int getToolOptionsCount() {
        return internalGetToolOptions().getMap().size();
      }
      /**
       * <pre>
       * Specifies the requirement for each tools.
       * </pre>
       *
       * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
       */

      public boolean containsToolOptions(
          java.lang.String key) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        return internalGetToolOptions().getMap().containsKey(key);
      }
      /**
       * Use {@link #getToolOptionsMap()} instead.
       */
      @java.lang.Deprecated
      public java.util.Map<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> getToolOptions() {
        return getToolOptionsMap();
      }
      /**
       * <pre>
       * Specifies the requirement for each tools.
       * </pre>
       *
       * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
       */

      public java.util.Map<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> getToolOptionsMap() {
        return internalGetToolOptions().getMap();
      }
      /**
       * <pre>
       * Specifies the requirement for each tools.
       * </pre>
       *
       * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
       */

      public tensorflow.TpuProfiler.ToolRequestOptions getToolOptionsOrDefault(
          java.lang.String key,
          tensorflow.TpuProfiler.ToolRequestOptions defaultValue) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        java.util.Map<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> map =
            internalGetToolOptions().getMap();
        return map.containsKey(key) ? map.get(key) : defaultValue;
      }
      /**
       * <pre>
       * Specifies the requirement for each tools.
       * </pre>
       *
       * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
       */

      public tensorflow.TpuProfiler.ToolRequestOptions getToolOptionsOrThrow(
          java.lang.String key) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        java.util.Map<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> map =
            internalGetToolOptions().getMap();
        if (!map.containsKey(key)) {
          throw new java.lang.IllegalArgumentException();
        }
        return map.get(key);
      }

      public Builder clearToolOptions() {
        internalGetMutableToolOptions().getMutableMap()
            .clear();
        return this;
      }
      /**
       * <pre>
       * Specifies the requirement for each tools.
       * </pre>
       *
       * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
       */

      public Builder removeToolOptions(
          java.lang.String key) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        internalGetMutableToolOptions().getMutableMap()
            .remove(key);
        return this;
      }
      /**
       * Use alternate mutation accessors instead.
       */
      @java.lang.Deprecated
      public java.util.Map<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions>
      getMutableToolOptions() {
        return internalGetMutableToolOptions().getMutableMap();
      }
      /**
       * <pre>
       * Specifies the requirement for each tools.
       * </pre>
       *
       * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
       */
      public Builder putToolOptions(
          java.lang.String key,
          tensorflow.TpuProfiler.ToolRequestOptions value) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        if (value == null) { throw new java.lang.NullPointerException(); }
        internalGetMutableToolOptions().getMutableMap()
            .put(key, value);
        return this;
      }
      /**
       * <pre>
       * Specifies the requirement for each tools.
       * </pre>
       *
       * <code>map&lt;string, .tensorflow.ToolRequestOptions&gt; tool_options = 8;</code>
       */

      public Builder putAllToolOptions(
          java.util.Map<java.lang.String, tensorflow.TpuProfiler.ToolRequestOptions> values) {
        internalGetMutableToolOptions().getMutableMap()
            .putAll(values);
        return this;
      }

      private tensorflow.TpuProfiler.ProfileOptions opts_ = null;
      private com.google.protobuf.SingleFieldBuilderV3<
          tensorflow.TpuProfiler.ProfileOptions, tensorflow.TpuProfiler.ProfileOptions.Builder, tensorflow.TpuProfiler.ProfileOptionsOrBuilder> optsBuilder_;
      /**
       * <pre>
       * Optional profiling options that control how a TF session will be profiled.
       * </pre>
       *
       * <code>.tensorflow.ProfileOptions opts = 4;</code>
       */
      public boolean hasOpts() {
        return optsBuilder_ != null || opts_ != null;
      }
      /**
       * <pre>
       * Optional profiling options that control how a TF session will be profiled.
       * </pre>
       *
       * <code>.tensorflow.ProfileOptions opts = 4;</code>
       */
      public tensorflow.TpuProfiler.ProfileOptions getOpts() {
        if (optsBuilder_ == null) {
          return opts_ == null ? tensorflow.TpuProfiler.ProfileOptions.getDefaultInstance() : opts_;
        } else {
          return optsBuilder_.getMessage();
        }
      }
      /**
       * <pre>
       * Optional profiling options that control how a TF session will be profiled.
       * </pre>
       *
       * <code>.tensorflow.ProfileOptions opts = 4;</code>
       */
      public Builder setOpts(tensorflow.TpuProfiler.ProfileOptions value) {
        if (optsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          opts_ = value;
          onChanged();
        } else {
          optsBuilder_.setMessage(value);
        }

        return this;
      }
      /**
       * <pre>
       * Optional profiling options that control how a TF session will be profiled.
       * </pre>
       *
       * <code>.tensorflow.ProfileOptions opts = 4;</code>
       */
      public Builder setOpts(
          tensorflow.TpuProfiler.ProfileOptions.Builder builderForValue) {
        if (optsBuilder_ == null) {
          opts_ = builderForValue.build();
          onChanged();
        } else {
          optsBuilder_.setMessage(builderForValue.build());
        }

        return this;
      }
      /**
       * <pre>
       * Optional profiling options that control how a TF session will be profiled.
       * </pre>
       *
       * <code>.tensorflow.ProfileOptions opts = 4;</code>
       */
      public Builder mergeOpts(tensorflow.TpuProfiler.ProfileOptions value) {
        if (optsBuilder_ == null) {
          if (opts_ != null) {
            opts_ =
              tensorflow.TpuProfiler.ProfileOptions.newBuilder(opts_).mergeFrom(value).buildPartial();
          } else {
            opts_ = value;
          }
          onChanged();
        } else {
          optsBuilder_.mergeFrom(value);
        }

        return this;
      }
      /**
       * <pre>
       * Optional profiling options that control how a TF session will be profiled.
       * </pre>
       *
       * <code>.tensorflow.ProfileOptions opts = 4;</code>
       */
      public Builder clearOpts() {
        if (optsBuilder_ == null) {
          opts_ = null;
          onChanged();
        } else {
          opts_ = null;
          optsBuilder_ = null;
        }

        return this;
      }
      /**
       * <pre>
       * Optional profiling options that control how a TF session will be profiled.
       * </pre>
       *
       * <code>.tensorflow.ProfileOptions opts = 4;</code>
       */
      public tensorflow.TpuProfiler.ProfileOptions.Builder getOptsBuilder() {
        
        onChanged();
        return getOptsFieldBuilder().getBuilder();
      }
      /**
       * <pre>
       * Optional profiling options that control how a TF session will be profiled.
       * </pre>
       *
       * <code>.tensorflow.ProfileOptions opts = 4;</code>
       */
      public tensorflow.TpuProfiler.ProfileOptionsOrBuilder getOptsOrBuilder() {
        if (optsBuilder_ != null) {
          return optsBuilder_.getMessageOrBuilder();
        } else {
          return opts_ == null ?
              tensorflow.TpuProfiler.ProfileOptions.getDefaultInstance() : opts_;
        }
      }
      /**
       * <pre>
       * Optional profiling options that control how a TF session will be profiled.
       * </pre>
       *
       * <code>.tensorflow.ProfileOptions opts = 4;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          tensorflow.TpuProfiler.ProfileOptions, tensorflow.TpuProfiler.ProfileOptions.Builder, tensorflow.TpuProfiler.ProfileOptionsOrBuilder> 
          getOptsFieldBuilder() {
        if (optsBuilder_ == null) {
          optsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              tensorflow.TpuProfiler.ProfileOptions, tensorflow.TpuProfiler.ProfileOptions.Builder, tensorflow.TpuProfiler.ProfileOptionsOrBuilder>(
                  getOpts(),
                  getParentForChildren(),
                  isClean());
          opts_ = null;
        }
        return optsBuilder_;
      }

      private java.lang.Object repositoryRoot_ = "";
      /**
       * <pre>
       * The place where we will dump profile data. We will normally use
       * MODEL_DIR/plugin/profile/ as our repository root.
       * </pre>
       *
       * <code>string repository_root = 5;</code>
       */
      public java.lang.String getRepositoryRoot() {
        java.lang.Object ref = repositoryRoot_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          repositoryRoot_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The place where we will dump profile data. We will normally use
       * MODEL_DIR/plugin/profile/ as our repository root.
       * </pre>
       *
       * <code>string repository_root = 5;</code>
       */
      public com.google.protobuf.ByteString
          getRepositoryRootBytes() {
        java.lang.Object ref = repositoryRoot_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          repositoryRoot_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The place where we will dump profile data. We will normally use
       * MODEL_DIR/plugin/profile/ as our repository root.
       * </pre>
       *
       * <code>string repository_root = 5;</code>
       */
      public Builder setRepositoryRoot(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        repositoryRoot_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The place where we will dump profile data. We will normally use
       * MODEL_DIR/plugin/profile/ as our repository root.
       * </pre>
       *
       * <code>string repository_root = 5;</code>
       */
      public Builder clearRepositoryRoot() {
        
        repositoryRoot_ = getDefaultInstance().getRepositoryRoot();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The place where we will dump profile data. We will normally use
       * MODEL_DIR/plugin/profile/ as our repository root.
       * </pre>
       *
       * <code>string repository_root = 5;</code>
       */
      public Builder setRepositoryRootBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        repositoryRoot_ = value;
        onChanged();
        return this;
      }

      private java.lang.Object sessionId_ = "";
      /**
       * <pre>
       * The user provided profile session identifier.
       * </pre>
       *
       * <code>string session_id = 6;</code>
       */
      public java.lang.String getSessionId() {
        java.lang.Object ref = sessionId_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          sessionId_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The user provided profile session identifier.
       * </pre>
       *
       * <code>string session_id = 6;</code>
       */
      public com.google.protobuf.ByteString
          getSessionIdBytes() {
        java.lang.Object ref = sessionId_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          sessionId_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The user provided profile session identifier.
       * </pre>
       *
       * <code>string session_id = 6;</code>
       */
      public Builder setSessionId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        sessionId_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The user provided profile session identifier.
       * </pre>
       *
       * <code>string session_id = 6;</code>
       */
      public Builder clearSessionId() {
        
        sessionId_ = getDefaultInstance().getSessionId();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The user provided profile session identifier.
       * </pre>
       *
       * <code>string session_id = 6;</code>
       */
      public Builder setSessionIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        sessionId_ = value;
        onChanged();
        return this;
      }

      private java.lang.Object hostName_ = "";
      /**
       * <pre>
       * The hostname of system where the profile should happen.
       * We use it as identifier in part of our output filename.
       * </pre>
       *
       * <code>string host_name = 7;</code>
       */
      public java.lang.String getHostName() {
        java.lang.Object ref = hostName_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          hostName_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The hostname of system where the profile should happen.
       * We use it as identifier in part of our output filename.
       * </pre>
       *
       * <code>string host_name = 7;</code>
       */
      public com.google.protobuf.ByteString
          getHostNameBytes() {
        java.lang.Object ref = hostName_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          hostName_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The hostname of system where the profile should happen.
       * We use it as identifier in part of our output filename.
       * </pre>
       *
       * <code>string host_name = 7;</code>
       */
      public Builder setHostName(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        hostName_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The hostname of system where the profile should happen.
       * We use it as identifier in part of our output filename.
       * </pre>
       *
       * <code>string host_name = 7;</code>
       */
      public Builder clearHostName() {
        
        hostName_ = getDefaultInstance().getHostName();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The hostname of system where the profile should happen.
       * We use it as identifier in part of our output filename.
       * </pre>
       *
       * <code>string host_name = 7;</code>
       */
      public Builder setHostNameBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        hostName_ = value;
        onChanged();
        return this;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }

      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }


      // @@protoc_insertion_point(builder_scope:tensorflow.ProfileRequest)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.ProfileRequest)
    private static final tensorflow.TpuProfiler.ProfileRequest DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new tensorflow.TpuProfiler.ProfileRequest();
    }

    public static tensorflow.TpuProfiler.ProfileRequest getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<ProfileRequest>
        PARSER = new com.google.protobuf.AbstractParser<ProfileRequest>() {
      public ProfileRequest parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
          return new ProfileRequest(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<ProfileRequest> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<ProfileRequest> getParserForType() {
      return PARSER;
    }

    public tensorflow.TpuProfiler.ProfileRequest getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface ProfileToolDataOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.ProfileToolData)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * The tool's name which this data is associated. (e.g. "input_pipeline".)
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    java.lang.String getName();
    /**
     * <pre>
     * The tool's name which this data is associated. (e.g. "input_pipeline".)
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    com.google.protobuf.ByteString
        getNameBytes();

    /**
     * <pre>
     * The data payload (likely json) for the specific tool.
     * </pre>
     *
     * <code>bytes data = 2;</code>
     */
    com.google.protobuf.ByteString getData();
  }
  /**
   * Protobuf type {@code tensorflow.ProfileToolData}
   */
  public  static final class ProfileToolData extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.ProfileToolData)
      ProfileToolDataOrBuilder {
    // Use ProfileToolData.newBuilder() to construct.
    private ProfileToolData(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private ProfileToolData() {
      name_ = "";
      data_ = com.google.protobuf.ByteString.EMPTY;
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
    }
    private ProfileToolData(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      int mutable_bitField0_ = 0;
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!input.skipField(tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
            case 18: {

              data_ = input.readBytes();
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileToolData_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileToolData_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              tensorflow.TpuProfiler.ProfileToolData.class, tensorflow.TpuProfiler.ProfileToolData.Builder.class);
    }

    public static final int NAME_FIELD_NUMBER = 1;
    private volatile java.lang.Object name_;
    /**
     * <pre>
     * The tool's name which this data is associated. (e.g. "input_pipeline".)
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The tool's name which this data is associated. (e.g. "input_pipeline".)
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public com.google.protobuf.ByteString
        getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int DATA_FIELD_NUMBER = 2;
    private com.google.protobuf.ByteString data_;
    /**
     * <pre>
     * The data payload (likely json) for the specific tool.
     * </pre>
     *
     * <code>bytes data = 2;</code>
     */
    public com.google.protobuf.ByteString getData() {
      return data_;
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!getNameBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
      }
      if (!data_.isEmpty()) {
        output.writeBytes(2, data_);
      }
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!getNameBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
      }
      if (!data_.isEmpty()) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(2, data_);
      }
      memoizedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof tensorflow.TpuProfiler.ProfileToolData)) {
        return super.equals(obj);
      }
      tensorflow.TpuProfiler.ProfileToolData other = (tensorflow.TpuProfiler.ProfileToolData) obj;

      boolean result = true;
      result = result && getName()
          .equals(other.getName());
      result = result && getData()
          .equals(other.getData());
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + NAME_FIELD_NUMBER;
      hash = (53 * hash) + getName().hashCode();
      hash = (37 * hash) + DATA_FIELD_NUMBER;
      hash = (53 * hash) + getData().hashCode();
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static tensorflow.TpuProfiler.ProfileToolData parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.TpuProfiler.ProfileToolData parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileToolData parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.TpuProfiler.ProfileToolData parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileToolData parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ProfileToolData parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileToolData parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ProfileToolData parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileToolData parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ProfileToolData parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(tensorflow.TpuProfiler.ProfileToolData prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code tensorflow.ProfileToolData}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.ProfileToolData)
        tensorflow.TpuProfiler.ProfileToolDataOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileToolData_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileToolData_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                tensorflow.TpuProfiler.ProfileToolData.class, tensorflow.TpuProfiler.ProfileToolData.Builder.class);
      }

      // Construct using tensorflow.TpuProfiler.ProfileToolData.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      public Builder clear() {
        super.clear();
        name_ = "";

        data_ = com.google.protobuf.ByteString.EMPTY;

        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileToolData_descriptor;
      }

      public tensorflow.TpuProfiler.ProfileToolData getDefaultInstanceForType() {
        return tensorflow.TpuProfiler.ProfileToolData.getDefaultInstance();
      }

      public tensorflow.TpuProfiler.ProfileToolData build() {
        tensorflow.TpuProfiler.ProfileToolData result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public tensorflow.TpuProfiler.ProfileToolData buildPartial() {
        tensorflow.TpuProfiler.ProfileToolData result = new tensorflow.TpuProfiler.ProfileToolData(this);
        result.name_ = name_;
        result.data_ = data_;
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof tensorflow.TpuProfiler.ProfileToolData) {
          return mergeFrom((tensorflow.TpuProfiler.ProfileToolData)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(tensorflow.TpuProfiler.ProfileToolData other) {
        if (other == tensorflow.TpuProfiler.ProfileToolData.getDefaultInstance()) return this;
        if (!other.getName().isEmpty()) {
          name_ = other.name_;
          onChanged();
        }
        if (other.getData() != com.google.protobuf.ByteString.EMPTY) {
          setData(other.getData());
        }
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        tensorflow.TpuProfiler.ProfileToolData parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (tensorflow.TpuProfiler.ProfileToolData) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private java.lang.Object name_ = "";
      /**
       * <pre>
       * The tool's name which this data is associated. (e.g. "input_pipeline".)
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public java.lang.String getName() {
        java.lang.Object ref = name_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          name_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The tool's name which this data is associated. (e.g. "input_pipeline".)
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public com.google.protobuf.ByteString
          getNameBytes() {
        java.lang.Object ref = name_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          name_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The tool's name which this data is associated. (e.g. "input_pipeline".)
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public Builder setName(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        name_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The tool's name which this data is associated. (e.g. "input_pipeline".)
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public Builder clearName() {
        
        name_ = getDefaultInstance().getName();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The tool's name which this data is associated. (e.g. "input_pipeline".)
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public Builder setNameBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        name_ = value;
        onChanged();
        return this;
      }

      private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY;
      /**
       * <pre>
       * The data payload (likely json) for the specific tool.
       * </pre>
       *
       * <code>bytes data = 2;</code>
       */
      public com.google.protobuf.ByteString getData() {
        return data_;
      }
      /**
       * <pre>
       * The data payload (likely json) for the specific tool.
       * </pre>
       *
       * <code>bytes data = 2;</code>
       */
      public Builder setData(com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        data_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The data payload (likely json) for the specific tool.
       * </pre>
       *
       * <code>bytes data = 2;</code>
       */
      public Builder clearData() {
        
        data_ = getDefaultInstance().getData();
        onChanged();
        return this;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }

      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }


      // @@protoc_insertion_point(builder_scope:tensorflow.ProfileToolData)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.ProfileToolData)
    private static final tensorflow.TpuProfiler.ProfileToolData DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new tensorflow.TpuProfiler.ProfileToolData();
    }

    public static tensorflow.TpuProfiler.ProfileToolData getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<ProfileToolData>
        PARSER = new com.google.protobuf.AbstractParser<ProfileToolData>() {
      public ProfileToolData parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
          return new ProfileToolData(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<ProfileToolData> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<ProfileToolData> getParserForType() {
      return PARSER;
    }

    public tensorflow.TpuProfiler.ProfileToolData getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface ProfileResponseOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.ProfileResponse)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * Graphs of programs executed on TPUs during the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
     */
    java.util.List<org.tensorflow.framework.GraphDef> 
        getComputationGraphList();
    /**
     * <pre>
     * Graphs of programs executed on TPUs during the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
     */
    org.tensorflow.framework.GraphDef getComputationGraph(int index);
    /**
     * <pre>
     * Graphs of programs executed on TPUs during the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
     */
    int getComputationGraphCount();
    /**
     * <pre>
     * Graphs of programs executed on TPUs during the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
     */
    java.util.List<? extends org.tensorflow.framework.GraphDefOrBuilder> 
        getComputationGraphOrBuilderList();
    /**
     * <pre>
     * Graphs of programs executed on TPUs during the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
     */
    org.tensorflow.framework.GraphDefOrBuilder getComputationGraphOrBuilder(
        int index);

    /**
     * <pre>
     * Performance profile that can be used to annotate HLO operations in the
     * computation graph.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
     */
    boolean hasHloMetadata();
    /**
     * <pre>
     * Performance profile that can be used to annotate HLO operations in the
     * computation graph.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
     */
    org.tensorflow.framework.RunMetadata getHloMetadata();
    /**
     * <pre>
     * Performance profile that can be used to annotate HLO operations in the
     * computation graph.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
     */
    org.tensorflow.framework.RunMetadataOrBuilder getHloMetadataOrBuilder();

    /**
     * <pre>
     * Encoded Trace proto message that contains metadata about the trace captured
     * during the profiling period. Describes the devices and resources that
     * 'trace_events' refers to.
     * </pre>
     *
     * <code>bytes encoded_trace = 3;</code>
     */
    com.google.protobuf.ByteString getEncodedTrace();

    /**
     * <pre>
     * Assembles a hierarchical performance profile based on HLOs in trace events.
     * If the trace covers multiple programs, the longest-running one is analyzed.
     * See op_profile.proto for the detailed semantics of the returned profile.
     * </pre>
     *
     * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
     */
    boolean hasOpProfile();
    /**
     * <pre>
     * Assembles a hierarchical performance profile based on HLOs in trace events.
     * If the trace covers multiple programs, the longest-running one is analyzed.
     * See op_profile.proto for the detailed semantics of the returned profile.
     * </pre>
     *
     * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
     */
    tensorflow.tpu.op_profile.OpProfile.Profile getOpProfile();
    /**
     * <pre>
     * Assembles a hierarchical performance profile based on HLOs in trace events.
     * If the trace covers multiple programs, the longest-running one is analyzed.
     * See op_profile.proto for the detailed semantics of the returned profile.
     * </pre>
     *
     * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
     */
    tensorflow.tpu.op_profile.OpProfile.ProfileOrBuilder getOpProfileOrBuilder();

    /**
     * <pre>
     * Data payload for each required tools.
     * </pre>
     *
     * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
     */
    java.util.List<tensorflow.TpuProfiler.ProfileToolData> 
        getToolDataList();
    /**
     * <pre>
     * Data payload for each required tools.
     * </pre>
     *
     * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
     */
    tensorflow.TpuProfiler.ProfileToolData getToolData(int index);
    /**
     * <pre>
     * Data payload for each required tools.
     * </pre>
     *
     * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
     */
    int getToolDataCount();
    /**
     * <pre>
     * Data payload for each required tools.
     * </pre>
     *
     * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
     */
    java.util.List<? extends tensorflow.TpuProfiler.ProfileToolDataOrBuilder> 
        getToolDataOrBuilderList();
    /**
     * <pre>
     * Data payload for each required tools.
     * </pre>
     *
     * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
     */
    tensorflow.TpuProfiler.ProfileToolDataOrBuilder getToolDataOrBuilder(
        int index);
  }
  /**
   * Protobuf type {@code tensorflow.ProfileResponse}
   */
  public  static final class ProfileResponse extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.ProfileResponse)
      ProfileResponseOrBuilder {
    // Use ProfileResponse.newBuilder() to construct.
    private ProfileResponse(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private ProfileResponse() {
      computationGraph_ = java.util.Collections.emptyList();
      encodedTrace_ = com.google.protobuf.ByteString.EMPTY;
      toolData_ = java.util.Collections.emptyList();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
    }
    private ProfileResponse(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      int mutable_bitField0_ = 0;
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!input.skipField(tag)) {
                done = true;
              }
              break;
            }
            case 18: {
              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
                computationGraph_ = new java.util.ArrayList<org.tensorflow.framework.GraphDef>();
                mutable_bitField0_ |= 0x00000001;
              }
              computationGraph_.add(
                  input.readMessage(org.tensorflow.framework.GraphDef.parser(), extensionRegistry));
              break;
            }
            case 26: {

              encodedTrace_ = input.readBytes();
              break;
            }
            case 34: {
              tensorflow.tpu.op_profile.OpProfile.Profile.Builder subBuilder = null;
              if (opProfile_ != null) {
                subBuilder = opProfile_.toBuilder();
              }
              opProfile_ = input.readMessage(tensorflow.tpu.op_profile.OpProfile.Profile.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(opProfile_);
                opProfile_ = subBuilder.buildPartial();
              }

              break;
            }
            case 42: {
              org.tensorflow.framework.RunMetadata.Builder subBuilder = null;
              if (hloMetadata_ != null) {
                subBuilder = hloMetadata_.toBuilder();
              }
              hloMetadata_ = input.readMessage(org.tensorflow.framework.RunMetadata.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(hloMetadata_);
                hloMetadata_ = subBuilder.buildPartial();
              }

              break;
            }
            case 50: {
              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
                toolData_ = new java.util.ArrayList<tensorflow.TpuProfiler.ProfileToolData>();
                mutable_bitField0_ |= 0x00000010;
              }
              toolData_.add(
                  input.readMessage(tensorflow.TpuProfiler.ProfileToolData.parser(), extensionRegistry));
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
          computationGraph_ = java.util.Collections.unmodifiableList(computationGraph_);
        }
        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
          toolData_ = java.util.Collections.unmodifiableList(toolData_);
        }
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileResponse_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileResponse_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              tensorflow.TpuProfiler.ProfileResponse.class, tensorflow.TpuProfiler.ProfileResponse.Builder.class);
    }

    private int bitField0_;
    public static final int COMPUTATION_GRAPH_FIELD_NUMBER = 2;
    private java.util.List<org.tensorflow.framework.GraphDef> computationGraph_;
    /**
     * <pre>
     * Graphs of programs executed on TPUs during the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
     */
    public java.util.List<org.tensorflow.framework.GraphDef> getComputationGraphList() {
      return computationGraph_;
    }
    /**
     * <pre>
     * Graphs of programs executed on TPUs during the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
     */
    public java.util.List<? extends org.tensorflow.framework.GraphDefOrBuilder> 
        getComputationGraphOrBuilderList() {
      return computationGraph_;
    }
    /**
     * <pre>
     * Graphs of programs executed on TPUs during the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
     */
    public int getComputationGraphCount() {
      return computationGraph_.size();
    }
    /**
     * <pre>
     * Graphs of programs executed on TPUs during the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
     */
    public org.tensorflow.framework.GraphDef getComputationGraph(int index) {
      return computationGraph_.get(index);
    }
    /**
     * <pre>
     * Graphs of programs executed on TPUs during the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
     */
    public org.tensorflow.framework.GraphDefOrBuilder getComputationGraphOrBuilder(
        int index) {
      return computationGraph_.get(index);
    }

    public static final int HLO_METADATA_FIELD_NUMBER = 5;
    private org.tensorflow.framework.RunMetadata hloMetadata_;
    /**
     * <pre>
     * Performance profile that can be used to annotate HLO operations in the
     * computation graph.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
     */
    public boolean hasHloMetadata() {
      return hloMetadata_ != null;
    }
    /**
     * <pre>
     * Performance profile that can be used to annotate HLO operations in the
     * computation graph.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
     */
    public org.tensorflow.framework.RunMetadata getHloMetadata() {
      return hloMetadata_ == null ? org.tensorflow.framework.RunMetadata.getDefaultInstance() : hloMetadata_;
    }
    /**
     * <pre>
     * Performance profile that can be used to annotate HLO operations in the
     * computation graph.
     * </pre>
     *
     * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
     */
    public org.tensorflow.framework.RunMetadataOrBuilder getHloMetadataOrBuilder() {
      return getHloMetadata();
    }

    public static final int ENCODED_TRACE_FIELD_NUMBER = 3;
    private com.google.protobuf.ByteString encodedTrace_;
    /**
     * <pre>
     * Encoded Trace proto message that contains metadata about the trace captured
     * during the profiling period. Describes the devices and resources that
     * 'trace_events' refers to.
     * </pre>
     *
     * <code>bytes encoded_trace = 3;</code>
     */
    public com.google.protobuf.ByteString getEncodedTrace() {
      return encodedTrace_;
    }

    public static final int OP_PROFILE_FIELD_NUMBER = 4;
    private tensorflow.tpu.op_profile.OpProfile.Profile opProfile_;
    /**
     * <pre>
     * Assembles a hierarchical performance profile based on HLOs in trace events.
     * If the trace covers multiple programs, the longest-running one is analyzed.
     * See op_profile.proto for the detailed semantics of the returned profile.
     * </pre>
     *
     * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
     */
    public boolean hasOpProfile() {
      return opProfile_ != null;
    }
    /**
     * <pre>
     * Assembles a hierarchical performance profile based on HLOs in trace events.
     * If the trace covers multiple programs, the longest-running one is analyzed.
     * See op_profile.proto for the detailed semantics of the returned profile.
     * </pre>
     *
     * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
     */
    public tensorflow.tpu.op_profile.OpProfile.Profile getOpProfile() {
      return opProfile_ == null ? tensorflow.tpu.op_profile.OpProfile.Profile.getDefaultInstance() : opProfile_;
    }
    /**
     * <pre>
     * Assembles a hierarchical performance profile based on HLOs in trace events.
     * If the trace covers multiple programs, the longest-running one is analyzed.
     * See op_profile.proto for the detailed semantics of the returned profile.
     * </pre>
     *
     * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
     */
    public tensorflow.tpu.op_profile.OpProfile.ProfileOrBuilder getOpProfileOrBuilder() {
      return getOpProfile();
    }

    public static final int TOOL_DATA_FIELD_NUMBER = 6;
    private java.util.List<tensorflow.TpuProfiler.ProfileToolData> toolData_;
    /**
     * <pre>
     * Data payload for each required tools.
     * </pre>
     *
     * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
     */
    public java.util.List<tensorflow.TpuProfiler.ProfileToolData> getToolDataList() {
      return toolData_;
    }
    /**
     * <pre>
     * Data payload for each required tools.
     * </pre>
     *
     * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
     */
    public java.util.List<? extends tensorflow.TpuProfiler.ProfileToolDataOrBuilder> 
        getToolDataOrBuilderList() {
      return toolData_;
    }
    /**
     * <pre>
     * Data payload for each required tools.
     * </pre>
     *
     * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
     */
    public int getToolDataCount() {
      return toolData_.size();
    }
    /**
     * <pre>
     * Data payload for each required tools.
     * </pre>
     *
     * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
     */
    public tensorflow.TpuProfiler.ProfileToolData getToolData(int index) {
      return toolData_.get(index);
    }
    /**
     * <pre>
     * Data payload for each required tools.
     * </pre>
     *
     * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
     */
    public tensorflow.TpuProfiler.ProfileToolDataOrBuilder getToolDataOrBuilder(
        int index) {
      return toolData_.get(index);
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      for (int i = 0; i < computationGraph_.size(); i++) {
        output.writeMessage(2, computationGraph_.get(i));
      }
      if (!encodedTrace_.isEmpty()) {
        output.writeBytes(3, encodedTrace_);
      }
      if (opProfile_ != null) {
        output.writeMessage(4, getOpProfile());
      }
      if (hloMetadata_ != null) {
        output.writeMessage(5, getHloMetadata());
      }
      for (int i = 0; i < toolData_.size(); i++) {
        output.writeMessage(6, toolData_.get(i));
      }
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      for (int i = 0; i < computationGraph_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, computationGraph_.get(i));
      }
      if (!encodedTrace_.isEmpty()) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(3, encodedTrace_);
      }
      if (opProfile_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(4, getOpProfile());
      }
      if (hloMetadata_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(5, getHloMetadata());
      }
      for (int i = 0; i < toolData_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(6, toolData_.get(i));
      }
      memoizedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof tensorflow.TpuProfiler.ProfileResponse)) {
        return super.equals(obj);
      }
      tensorflow.TpuProfiler.ProfileResponse other = (tensorflow.TpuProfiler.ProfileResponse) obj;

      boolean result = true;
      result = result && getComputationGraphList()
          .equals(other.getComputationGraphList());
      result = result && (hasHloMetadata() == other.hasHloMetadata());
      if (hasHloMetadata()) {
        result = result && getHloMetadata()
            .equals(other.getHloMetadata());
      }
      result = result && getEncodedTrace()
          .equals(other.getEncodedTrace());
      result = result && (hasOpProfile() == other.hasOpProfile());
      if (hasOpProfile()) {
        result = result && getOpProfile()
            .equals(other.getOpProfile());
      }
      result = result && getToolDataList()
          .equals(other.getToolDataList());
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      if (getComputationGraphCount() > 0) {
        hash = (37 * hash) + COMPUTATION_GRAPH_FIELD_NUMBER;
        hash = (53 * hash) + getComputationGraphList().hashCode();
      }
      if (hasHloMetadata()) {
        hash = (37 * hash) + HLO_METADATA_FIELD_NUMBER;
        hash = (53 * hash) + getHloMetadata().hashCode();
      }
      hash = (37 * hash) + ENCODED_TRACE_FIELD_NUMBER;
      hash = (53 * hash) + getEncodedTrace().hashCode();
      if (hasOpProfile()) {
        hash = (37 * hash) + OP_PROFILE_FIELD_NUMBER;
        hash = (53 * hash) + getOpProfile().hashCode();
      }
      if (getToolDataCount() > 0) {
        hash = (37 * hash) + TOOL_DATA_FIELD_NUMBER;
        hash = (53 * hash) + getToolDataList().hashCode();
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static tensorflow.TpuProfiler.ProfileResponse parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.TpuProfiler.ProfileResponse parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileResponse parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.TpuProfiler.ProfileResponse parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileResponse parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ProfileResponse parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileResponse parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ProfileResponse parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
    }
    public static tensorflow.TpuProfiler.ProfileResponse parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.TpuProfiler.ProfileResponse parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input, extensionRegistry);
    }

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(tensorflow.TpuProfiler.ProfileResponse prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code tensorflow.ProfileResponse}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.ProfileResponse)
        tensorflow.TpuProfiler.ProfileResponseOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileResponse_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileResponse_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                tensorflow.TpuProfiler.ProfileResponse.class, tensorflow.TpuProfiler.ProfileResponse.Builder.class);
      }

      // Construct using tensorflow.TpuProfiler.ProfileResponse.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
          getComputationGraphFieldBuilder();
          getToolDataFieldBuilder();
        }
      }
      public Builder clear() {
        super.clear();
        if (computationGraphBuilder_ == null) {
          computationGraph_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          computationGraphBuilder_.clear();
        }
        if (hloMetadataBuilder_ == null) {
          hloMetadata_ = null;
        } else {
          hloMetadata_ = null;
          hloMetadataBuilder_ = null;
        }
        encodedTrace_ = com.google.protobuf.ByteString.EMPTY;

        if (opProfileBuilder_ == null) {
          opProfile_ = null;
        } else {
          opProfile_ = null;
          opProfileBuilder_ = null;
        }
        if (toolDataBuilder_ == null) {
          toolData_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000010);
        } else {
          toolDataBuilder_.clear();
        }
        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return tensorflow.TpuProfiler.internal_static_tensorflow_ProfileResponse_descriptor;
      }

      public tensorflow.TpuProfiler.ProfileResponse getDefaultInstanceForType() {
        return tensorflow.TpuProfiler.ProfileResponse.getDefaultInstance();
      }

      public tensorflow.TpuProfiler.ProfileResponse build() {
        tensorflow.TpuProfiler.ProfileResponse result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public tensorflow.TpuProfiler.ProfileResponse buildPartial() {
        tensorflow.TpuProfiler.ProfileResponse result = new tensorflow.TpuProfiler.ProfileResponse(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (computationGraphBuilder_ == null) {
          if (((bitField0_ & 0x00000001) == 0x00000001)) {
            computationGraph_ = java.util.Collections.unmodifiableList(computationGraph_);
            bitField0_ = (bitField0_ & ~0x00000001);
          }
          result.computationGraph_ = computationGraph_;
        } else {
          result.computationGraph_ = computationGraphBuilder_.build();
        }
        if (hloMetadataBuilder_ == null) {
          result.hloMetadata_ = hloMetadata_;
        } else {
          result.hloMetadata_ = hloMetadataBuilder_.build();
        }
        result.encodedTrace_ = encodedTrace_;
        if (opProfileBuilder_ == null) {
          result.opProfile_ = opProfile_;
        } else {
          result.opProfile_ = opProfileBuilder_.build();
        }
        if (toolDataBuilder_ == null) {
          if (((bitField0_ & 0x00000010) == 0x00000010)) {
            toolData_ = java.util.Collections.unmodifiableList(toolData_);
            bitField0_ = (bitField0_ & ~0x00000010);
          }
          result.toolData_ = toolData_;
        } else {
          result.toolData_ = toolDataBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof tensorflow.TpuProfiler.ProfileResponse) {
          return mergeFrom((tensorflow.TpuProfiler.ProfileResponse)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(tensorflow.TpuProfiler.ProfileResponse other) {
        if (other == tensorflow.TpuProfiler.ProfileResponse.getDefaultInstance()) return this;
        if (computationGraphBuilder_ == null) {
          if (!other.computationGraph_.isEmpty()) {
            if (computationGraph_.isEmpty()) {
              computationGraph_ = other.computationGraph_;
              bitField0_ = (bitField0_ & ~0x00000001);
            } else {
              ensureComputationGraphIsMutable();
              computationGraph_.addAll(other.computationGraph_);
            }
            onChanged();
          }
        } else {
          if (!other.computationGraph_.isEmpty()) {
            if (computationGraphBuilder_.isEmpty()) {
              computationGraphBuilder_.dispose();
              computationGraphBuilder_ = null;
              computationGraph_ = other.computationGraph_;
              bitField0_ = (bitField0_ & ~0x00000001);
              computationGraphBuilder_ = 
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                   getComputationGraphFieldBuilder() : null;
            } else {
              computationGraphBuilder_.addAllMessages(other.computationGraph_);
            }
          }
        }
        if (other.hasHloMetadata()) {
          mergeHloMetadata(other.getHloMetadata());
        }
        if (other.getEncodedTrace() != com.google.protobuf.ByteString.EMPTY) {
          setEncodedTrace(other.getEncodedTrace());
        }
        if (other.hasOpProfile()) {
          mergeOpProfile(other.getOpProfile());
        }
        if (toolDataBuilder_ == null) {
          if (!other.toolData_.isEmpty()) {
            if (toolData_.isEmpty()) {
              toolData_ = other.toolData_;
              bitField0_ = (bitField0_ & ~0x00000010);
            } else {
              ensureToolDataIsMutable();
              toolData_.addAll(other.toolData_);
            }
            onChanged();
          }
        } else {
          if (!other.toolData_.isEmpty()) {
            if (toolDataBuilder_.isEmpty()) {
              toolDataBuilder_.dispose();
              toolDataBuilder_ = null;
              toolData_ = other.toolData_;
              bitField0_ = (bitField0_ & ~0x00000010);
              toolDataBuilder_ = 
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                   getToolDataFieldBuilder() : null;
            } else {
              toolDataBuilder_.addAllMessages(other.toolData_);
            }
          }
        }
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        tensorflow.TpuProfiler.ProfileResponse parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (tensorflow.TpuProfiler.ProfileResponse) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      private java.util.List<org.tensorflow.framework.GraphDef> computationGraph_ =
        java.util.Collections.emptyList();
      private void ensureComputationGraphIsMutable() {
        if (!((bitField0_ & 0x00000001) == 0x00000001)) {
          computationGraph_ = new java.util.ArrayList<org.tensorflow.framework.GraphDef>(computationGraph_);
          bitField0_ |= 0x00000001;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
          org.tensorflow.framework.GraphDef, org.tensorflow.framework.GraphDef.Builder, org.tensorflow.framework.GraphDefOrBuilder> computationGraphBuilder_;

      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public java.util.List<org.tensorflow.framework.GraphDef> getComputationGraphList() {
        if (computationGraphBuilder_ == null) {
          return java.util.Collections.unmodifiableList(computationGraph_);
        } else {
          return computationGraphBuilder_.getMessageList();
        }
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public int getComputationGraphCount() {
        if (computationGraphBuilder_ == null) {
          return computationGraph_.size();
        } else {
          return computationGraphBuilder_.getCount();
        }
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public org.tensorflow.framework.GraphDef getComputationGraph(int index) {
        if (computationGraphBuilder_ == null) {
          return computationGraph_.get(index);
        } else {
          return computationGraphBuilder_.getMessage(index);
        }
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public Builder setComputationGraph(
          int index, org.tensorflow.framework.GraphDef value) {
        if (computationGraphBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureComputationGraphIsMutable();
          computationGraph_.set(index, value);
          onChanged();
        } else {
          computationGraphBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public Builder setComputationGraph(
          int index, org.tensorflow.framework.GraphDef.Builder builderForValue) {
        if (computationGraphBuilder_ == null) {
          ensureComputationGraphIsMutable();
          computationGraph_.set(index, builderForValue.build());
          onChanged();
        } else {
          computationGraphBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public Builder addComputationGraph(org.tensorflow.framework.GraphDef value) {
        if (computationGraphBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureComputationGraphIsMutable();
          computationGraph_.add(value);
          onChanged();
        } else {
          computationGraphBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public Builder addComputationGraph(
          int index, org.tensorflow.framework.GraphDef value) {
        if (computationGraphBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureComputationGraphIsMutable();
          computationGraph_.add(index, value);
          onChanged();
        } else {
          computationGraphBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public Builder addComputationGraph(
          org.tensorflow.framework.GraphDef.Builder builderForValue) {
        if (computationGraphBuilder_ == null) {
          ensureComputationGraphIsMutable();
          computationGraph_.add(builderForValue.build());
          onChanged();
        } else {
          computationGraphBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public Builder addComputationGraph(
          int index, org.tensorflow.framework.GraphDef.Builder builderForValue) {
        if (computationGraphBuilder_ == null) {
          ensureComputationGraphIsMutable();
          computationGraph_.add(index, builderForValue.build());
          onChanged();
        } else {
          computationGraphBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public Builder addAllComputationGraph(
          java.lang.Iterable<? extends org.tensorflow.framework.GraphDef> values) {
        if (computationGraphBuilder_ == null) {
          ensureComputationGraphIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(
              values, computationGraph_);
          onChanged();
        } else {
          computationGraphBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public Builder clearComputationGraph() {
        if (computationGraphBuilder_ == null) {
          computationGraph_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
        } else {
          computationGraphBuilder_.clear();
        }
        return this;
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public Builder removeComputationGraph(int index) {
        if (computationGraphBuilder_ == null) {
          ensureComputationGraphIsMutable();
          computationGraph_.remove(index);
          onChanged();
        } else {
          computationGraphBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public org.tensorflow.framework.GraphDef.Builder getComputationGraphBuilder(
          int index) {
        return getComputationGraphFieldBuilder().getBuilder(index);
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public org.tensorflow.framework.GraphDefOrBuilder getComputationGraphOrBuilder(
          int index) {
        if (computationGraphBuilder_ == null) {
          return computationGraph_.get(index);  } else {
          return computationGraphBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public java.util.List<? extends org.tensorflow.framework.GraphDefOrBuilder> 
           getComputationGraphOrBuilderList() {
        if (computationGraphBuilder_ != null) {
          return computationGraphBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(computationGraph_);
        }
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public org.tensorflow.framework.GraphDef.Builder addComputationGraphBuilder() {
        return getComputationGraphFieldBuilder().addBuilder(
            org.tensorflow.framework.GraphDef.getDefaultInstance());
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public org.tensorflow.framework.GraphDef.Builder addComputationGraphBuilder(
          int index) {
        return getComputationGraphFieldBuilder().addBuilder(
            index, org.tensorflow.framework.GraphDef.getDefaultInstance());
      }
      /**
       * <pre>
       * Graphs of programs executed on TPUs during the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.GraphDef computation_graph = 2;</code>
       */
      public java.util.List<org.tensorflow.framework.GraphDef.Builder> 
           getComputationGraphBuilderList() {
        return getComputationGraphFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilderV3<
          org.tensorflow.framework.GraphDef, org.tensorflow.framework.GraphDef.Builder, org.tensorflow.framework.GraphDefOrBuilder> 
          getComputationGraphFieldBuilder() {
        if (computationGraphBuilder_ == null) {
          computationGraphBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
              org.tensorflow.framework.GraphDef, org.tensorflow.framework.GraphDef.Builder, org.tensorflow.framework.GraphDefOrBuilder>(
                  computationGraph_,
                  ((bitField0_ & 0x00000001) == 0x00000001),
                  getParentForChildren(),
                  isClean());
          computationGraph_ = null;
        }
        return computationGraphBuilder_;
      }

      private org.tensorflow.framework.RunMetadata hloMetadata_ = null;
      private com.google.protobuf.SingleFieldBuilderV3<
          org.tensorflow.framework.RunMetadata, org.tensorflow.framework.RunMetadata.Builder, org.tensorflow.framework.RunMetadataOrBuilder> hloMetadataBuilder_;
      /**
       * <pre>
       * Performance profile that can be used to annotate HLO operations in the
       * computation graph.
       * </pre>
       *
       * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
       */
      public boolean hasHloMetadata() {
        return hloMetadataBuilder_ != null || hloMetadata_ != null;
      }
      /**
       * <pre>
       * Performance profile that can be used to annotate HLO operations in the
       * computation graph.
       * </pre>
       *
       * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
       */
      public org.tensorflow.framework.RunMetadata getHloMetadata() {
        if (hloMetadataBuilder_ == null) {
          return hloMetadata_ == null ? org.tensorflow.framework.RunMetadata.getDefaultInstance() : hloMetadata_;
        } else {
          return hloMetadataBuilder_.getMessage();
        }
      }
      /**
       * <pre>
       * Performance profile that can be used to annotate HLO operations in the
       * computation graph.
       * </pre>
       *
       * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
       */
      public Builder setHloMetadata(org.tensorflow.framework.RunMetadata value) {
        if (hloMetadataBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          hloMetadata_ = value;
          onChanged();
        } else {
          hloMetadataBuilder_.setMessage(value);
        }

        return this;
      }
      /**
       * <pre>
       * Performance profile that can be used to annotate HLO operations in the
       * computation graph.
       * </pre>
       *
       * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
       */
      public Builder setHloMetadata(
          org.tensorflow.framework.RunMetadata.Builder builderForValue) {
        if (hloMetadataBuilder_ == null) {
          hloMetadata_ = builderForValue.build();
          onChanged();
        } else {
          hloMetadataBuilder_.setMessage(builderForValue.build());
        }

        return this;
      }
      /**
       * <pre>
       * Performance profile that can be used to annotate HLO operations in the
       * computation graph.
       * </pre>
       *
       * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
       */
      public Builder mergeHloMetadata(org.tensorflow.framework.RunMetadata value) {
        if (hloMetadataBuilder_ == null) {
          if (hloMetadata_ != null) {
            hloMetadata_ =
              org.tensorflow.framework.RunMetadata.newBuilder(hloMetadata_).mergeFrom(value).buildPartial();
          } else {
            hloMetadata_ = value;
          }
          onChanged();
        } else {
          hloMetadataBuilder_.mergeFrom(value);
        }

        return this;
      }
      /**
       * <pre>
       * Performance profile that can be used to annotate HLO operations in the
       * computation graph.
       * </pre>
       *
       * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
       */
      public Builder clearHloMetadata() {
        if (hloMetadataBuilder_ == null) {
          hloMetadata_ = null;
          onChanged();
        } else {
          hloMetadata_ = null;
          hloMetadataBuilder_ = null;
        }

        return this;
      }
      /**
       * <pre>
       * Performance profile that can be used to annotate HLO operations in the
       * computation graph.
       * </pre>
       *
       * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
       */
      public org.tensorflow.framework.RunMetadata.Builder getHloMetadataBuilder() {
        
        onChanged();
        return getHloMetadataFieldBuilder().getBuilder();
      }
      /**
       * <pre>
       * Performance profile that can be used to annotate HLO operations in the
       * computation graph.
       * </pre>
       *
       * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
       */
      public org.tensorflow.framework.RunMetadataOrBuilder getHloMetadataOrBuilder() {
        if (hloMetadataBuilder_ != null) {
          return hloMetadataBuilder_.getMessageOrBuilder();
        } else {
          return hloMetadata_ == null ?
              org.tensorflow.framework.RunMetadata.getDefaultInstance() : hloMetadata_;
        }
      }
      /**
       * <pre>
       * Performance profile that can be used to annotate HLO operations in the
       * computation graph.
       * </pre>
       *
       * <code>.tensorflow.RunMetadata hlo_metadata = 5;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          org.tensorflow.framework.RunMetadata, org.tensorflow.framework.RunMetadata.Builder, org.tensorflow.framework.RunMetadataOrBuilder> 
          getHloMetadataFieldBuilder() {
        if (hloMetadataBuilder_ == null) {
          hloMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              org.tensorflow.framework.RunMetadata, org.tensorflow.framework.RunMetadata.Builder, org.tensorflow.framework.RunMetadataOrBuilder>(
                  getHloMetadata(),
                  getParentForChildren(),
                  isClean());
          hloMetadata_ = null;
        }
        return hloMetadataBuilder_;
      }

      private com.google.protobuf.ByteString encodedTrace_ = com.google.protobuf.ByteString.EMPTY;
      /**
       * <pre>
       * Encoded Trace proto message that contains metadata about the trace captured
       * during the profiling period. Describes the devices and resources that
       * 'trace_events' refers to.
       * </pre>
       *
       * <code>bytes encoded_trace = 3;</code>
       */
      public com.google.protobuf.ByteString getEncodedTrace() {
        return encodedTrace_;
      }
      /**
       * <pre>
       * Encoded Trace proto message that contains metadata about the trace captured
       * during the profiling period. Describes the devices and resources that
       * 'trace_events' refers to.
       * </pre>
       *
       * <code>bytes encoded_trace = 3;</code>
       */
      public Builder setEncodedTrace(com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        encodedTrace_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * Encoded Trace proto message that contains metadata about the trace captured
       * during the profiling period. Describes the devices and resources that
       * 'trace_events' refers to.
       * </pre>
       *
       * <code>bytes encoded_trace = 3;</code>
       */
      public Builder clearEncodedTrace() {
        
        encodedTrace_ = getDefaultInstance().getEncodedTrace();
        onChanged();
        return this;
      }

      private tensorflow.tpu.op_profile.OpProfile.Profile opProfile_ = null;
      private com.google.protobuf.SingleFieldBuilderV3<
          tensorflow.tpu.op_profile.OpProfile.Profile, tensorflow.tpu.op_profile.OpProfile.Profile.Builder, tensorflow.tpu.op_profile.OpProfile.ProfileOrBuilder> opProfileBuilder_;
      /**
       * <pre>
       * Assembles a hierarchical performance profile based on HLOs in trace events.
       * If the trace covers multiple programs, the longest-running one is analyzed.
       * See op_profile.proto for the detailed semantics of the returned profile.
       * </pre>
       *
       * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
       */
      public boolean hasOpProfile() {
        return opProfileBuilder_ != null || opProfile_ != null;
      }
      /**
       * <pre>
       * Assembles a hierarchical performance profile based on HLOs in trace events.
       * If the trace covers multiple programs, the longest-running one is analyzed.
       * See op_profile.proto for the detailed semantics of the returned profile.
       * </pre>
       *
       * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
       */
      public tensorflow.tpu.op_profile.OpProfile.Profile getOpProfile() {
        if (opProfileBuilder_ == null) {
          return opProfile_ == null ? tensorflow.tpu.op_profile.OpProfile.Profile.getDefaultInstance() : opProfile_;
        } else {
          return opProfileBuilder_.getMessage();
        }
      }
      /**
       * <pre>
       * Assembles a hierarchical performance profile based on HLOs in trace events.
       * If the trace covers multiple programs, the longest-running one is analyzed.
       * See op_profile.proto for the detailed semantics of the returned profile.
       * </pre>
       *
       * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
       */
      public Builder setOpProfile(tensorflow.tpu.op_profile.OpProfile.Profile value) {
        if (opProfileBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          opProfile_ = value;
          onChanged();
        } else {
          opProfileBuilder_.setMessage(value);
        }

        return this;
      }
      /**
       * <pre>
       * Assembles a hierarchical performance profile based on HLOs in trace events.
       * If the trace covers multiple programs, the longest-running one is analyzed.
       * See op_profile.proto for the detailed semantics of the returned profile.
       * </pre>
       *
       * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
       */
      public Builder setOpProfile(
          tensorflow.tpu.op_profile.OpProfile.Profile.Builder builderForValue) {
        if (opProfileBuilder_ == null) {
          opProfile_ = builderForValue.build();
          onChanged();
        } else {
          opProfileBuilder_.setMessage(builderForValue.build());
        }

        return this;
      }
      /**
       * <pre>
       * Assembles a hierarchical performance profile based on HLOs in trace events.
       * If the trace covers multiple programs, the longest-running one is analyzed.
       * See op_profile.proto for the detailed semantics of the returned profile.
       * </pre>
       *
       * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
       */
      public Builder mergeOpProfile(tensorflow.tpu.op_profile.OpProfile.Profile value) {
        if (opProfileBuilder_ == null) {
          if (opProfile_ != null) {
            opProfile_ =
              tensorflow.tpu.op_profile.OpProfile.Profile.newBuilder(opProfile_).mergeFrom(value).buildPartial();
          } else {
            opProfile_ = value;
          }
          onChanged();
        } else {
          opProfileBuilder_.mergeFrom(value);
        }

        return this;
      }
      /**
       * <pre>
       * Assembles a hierarchical performance profile based on HLOs in trace events.
       * If the trace covers multiple programs, the longest-running one is analyzed.
       * See op_profile.proto for the detailed semantics of the returned profile.
       * </pre>
       *
       * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
       */
      public Builder clearOpProfile() {
        if (opProfileBuilder_ == null) {
          opProfile_ = null;
          onChanged();
        } else {
          opProfile_ = null;
          opProfileBuilder_ = null;
        }

        return this;
      }
      /**
       * <pre>
       * Assembles a hierarchical performance profile based on HLOs in trace events.
       * If the trace covers multiple programs, the longest-running one is analyzed.
       * See op_profile.proto for the detailed semantics of the returned profile.
       * </pre>
       *
       * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
       */
      public tensorflow.tpu.op_profile.OpProfile.Profile.Builder getOpProfileBuilder() {
        
        onChanged();
        return getOpProfileFieldBuilder().getBuilder();
      }
      /**
       * <pre>
       * Assembles a hierarchical performance profile based on HLOs in trace events.
       * If the trace covers multiple programs, the longest-running one is analyzed.
       * See op_profile.proto for the detailed semantics of the returned profile.
       * </pre>
       *
       * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
       */
      public tensorflow.tpu.op_profile.OpProfile.ProfileOrBuilder getOpProfileOrBuilder() {
        if (opProfileBuilder_ != null) {
          return opProfileBuilder_.getMessageOrBuilder();
        } else {
          return opProfile_ == null ?
              tensorflow.tpu.op_profile.OpProfile.Profile.getDefaultInstance() : opProfile_;
        }
      }
      /**
       * <pre>
       * Assembles a hierarchical performance profile based on HLOs in trace events.
       * If the trace covers multiple programs, the longest-running one is analyzed.
       * See op_profile.proto for the detailed semantics of the returned profile.
       * </pre>
       *
       * <code>.tensorflow.tpu.op_profile.Profile op_profile = 4;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          tensorflow.tpu.op_profile.OpProfile.Profile, tensorflow.tpu.op_profile.OpProfile.Profile.Builder, tensorflow.tpu.op_profile.OpProfile.ProfileOrBuilder> 
          getOpProfileFieldBuilder() {
        if (opProfileBuilder_ == null) {
          opProfileBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              tensorflow.tpu.op_profile.OpProfile.Profile, tensorflow.tpu.op_profile.OpProfile.Profile.Builder, tensorflow.tpu.op_profile.OpProfile.ProfileOrBuilder>(
                  getOpProfile(),
                  getParentForChildren(),
                  isClean());
          opProfile_ = null;
        }
        return opProfileBuilder_;
      }

      private java.util.List<tensorflow.TpuProfiler.ProfileToolData> toolData_ =
        java.util.Collections.emptyList();
      private void ensureToolDataIsMutable() {
        if (!((bitField0_ & 0x00000010) == 0x00000010)) {
          toolData_ = new java.util.ArrayList<tensorflow.TpuProfiler.ProfileToolData>(toolData_);
          bitField0_ |= 0x00000010;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
          tensorflow.TpuProfiler.ProfileToolData, tensorflow.TpuProfiler.ProfileToolData.Builder, tensorflow.TpuProfiler.ProfileToolDataOrBuilder> toolDataBuilder_;

      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public java.util.List<tensorflow.TpuProfiler.ProfileToolData> getToolDataList() {
        if (toolDataBuilder_ == null) {
          return java.util.Collections.unmodifiableList(toolData_);
        } else {
          return toolDataBuilder_.getMessageList();
        }
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public int getToolDataCount() {
        if (toolDataBuilder_ == null) {
          return toolData_.size();
        } else {
          return toolDataBuilder_.getCount();
        }
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public tensorflow.TpuProfiler.ProfileToolData getToolData(int index) {
        if (toolDataBuilder_ == null) {
          return toolData_.get(index);
        } else {
          return toolDataBuilder_.getMessage(index);
        }
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public Builder setToolData(
          int index, tensorflow.TpuProfiler.ProfileToolData value) {
        if (toolDataBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureToolDataIsMutable();
          toolData_.set(index, value);
          onChanged();
        } else {
          toolDataBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public Builder setToolData(
          int index, tensorflow.TpuProfiler.ProfileToolData.Builder builderForValue) {
        if (toolDataBuilder_ == null) {
          ensureToolDataIsMutable();
          toolData_.set(index, builderForValue.build());
          onChanged();
        } else {
          toolDataBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public Builder addToolData(tensorflow.TpuProfiler.ProfileToolData value) {
        if (toolDataBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureToolDataIsMutable();
          toolData_.add(value);
          onChanged();
        } else {
          toolDataBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public Builder addToolData(
          int index, tensorflow.TpuProfiler.ProfileToolData value) {
        if (toolDataBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureToolDataIsMutable();
          toolData_.add(index, value);
          onChanged();
        } else {
          toolDataBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public Builder addToolData(
          tensorflow.TpuProfiler.ProfileToolData.Builder builderForValue) {
        if (toolDataBuilder_ == null) {
          ensureToolDataIsMutable();
          toolData_.add(builderForValue.build());
          onChanged();
        } else {
          toolDataBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public Builder addToolData(
          int index, tensorflow.TpuProfiler.ProfileToolData.Builder builderForValue) {
        if (toolDataBuilder_ == null) {
          ensureToolDataIsMutable();
          toolData_.add(index, builderForValue.build());
          onChanged();
        } else {
          toolDataBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public Builder addAllToolData(
          java.lang.Iterable<? extends tensorflow.TpuProfiler.ProfileToolData> values) {
        if (toolDataBuilder_ == null) {
          ensureToolDataIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(
              values, toolData_);
          onChanged();
        } else {
          toolDataBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public Builder clearToolData() {
        if (toolDataBuilder_ == null) {
          toolData_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000010);
          onChanged();
        } else {
          toolDataBuilder_.clear();
        }
        return this;
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public Builder removeToolData(int index) {
        if (toolDataBuilder_ == null) {
          ensureToolDataIsMutable();
          toolData_.remove(index);
          onChanged();
        } else {
          toolDataBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public tensorflow.TpuProfiler.ProfileToolData.Builder getToolDataBuilder(
          int index) {
        return getToolDataFieldBuilder().getBuilder(index);
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public tensorflow.TpuProfiler.ProfileToolDataOrBuilder getToolDataOrBuilder(
          int index) {
        if (toolDataBuilder_ == null) {
          return toolData_.get(index);  } else {
          return toolDataBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public java.util.List<? extends tensorflow.TpuProfiler.ProfileToolDataOrBuilder> 
           getToolDataOrBuilderList() {
        if (toolDataBuilder_ != null) {
          return toolDataBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(toolData_);
        }
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public tensorflow.TpuProfiler.ProfileToolData.Builder addToolDataBuilder() {
        return getToolDataFieldBuilder().addBuilder(
            tensorflow.TpuProfiler.ProfileToolData.getDefaultInstance());
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public tensorflow.TpuProfiler.ProfileToolData.Builder addToolDataBuilder(
          int index) {
        return getToolDataFieldBuilder().addBuilder(
            index, tensorflow.TpuProfiler.ProfileToolData.getDefaultInstance());
      }
      /**
       * <pre>
       * Data payload for each required tools.
       * </pre>
       *
       * <code>repeated .tensorflow.ProfileToolData tool_data = 6;</code>
       */
      public java.util.List<tensorflow.TpuProfiler.ProfileToolData.Builder> 
           getToolDataBuilderList() {
        return getToolDataFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilderV3<
          tensorflow.TpuProfiler.ProfileToolData, tensorflow.TpuProfiler.ProfileToolData.Builder, tensorflow.TpuProfiler.ProfileToolDataOrBuilder> 
          getToolDataFieldBuilder() {
        if (toolDataBuilder_ == null) {
          toolDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
              tensorflow.TpuProfiler.ProfileToolData, tensorflow.TpuProfiler.ProfileToolData.Builder, tensorflow.TpuProfiler.ProfileToolDataOrBuilder>(
                  toolData_,
                  ((bitField0_ & 0x00000010) == 0x00000010),
                  getParentForChildren(),
                  isClean());
          toolData_ = null;
        }
        return toolDataBuilder_;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }

      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }


      // @@protoc_insertion_point(builder_scope:tensorflow.ProfileResponse)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.ProfileResponse)
    private static final tensorflow.TpuProfiler.ProfileResponse DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new tensorflow.TpuProfiler.ProfileResponse();
    }

    public static tensorflow.TpuProfiler.ProfileResponse getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<ProfileResponse>
        PARSER = new com.google.protobuf.AbstractParser<ProfileResponse>() {
      public ProfileResponse parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
          return new ProfileResponse(input, extensionRegistry);
      }
    };

    public static com.google.protobuf.Parser<ProfileResponse> parser() {
      return PARSER;
    }

    @java.lang.Override
    public com.google.protobuf.Parser<ProfileResponse> getParserForType() {
      return PARSER;
    }

    public tensorflow.TpuProfiler.ProfileResponse getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_ProfileOptions_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_ProfileOptions_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_ToolRequestOptions_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_ToolRequestOptions_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_ProfileRequest_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_ProfileRequest_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_ProfileRequest_ToolOptionsEntry_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_ProfileRequest_ToolOptionsEntry_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_ProfileToolData_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_ProfileToolData_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_ProfileResponse_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_ProfileResponse_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n2tensorflow/contrib/tpu/profiler/tpu_pr" +
      "ofiler.proto\022\ntensorflow\032%tensorflow/cor" +
      "e/framework/graph.proto\032%tensorflow/core" +
      "/protobuf/config.proto\0320tensorflow/contr" +
      "ib/tpu/profiler/op_profile.proto\"-\n\016Prof" +
      "ileOptions\022\033\n\023include_dataset_ops\030\001 \001(\010\"" +
      "B\n\022ToolRequestOptions\022\026\n\016output_formats\030" +
      "\002 \001(\t\022\024\n\014save_to_repo\030\003 \001(\010\"\311\002\n\016ProfileR" +
      "equest\022\023\n\013duration_ms\030\001 \001(\004\022\022\n\nmax_event" +
      "s\030\002 \001(\004\022\r\n\005tools\030\003 \003(\t\022A\n\014tool_options\030\010",
      " \003(\0132+.tensorflow.ProfileRequest.ToolOpt" +
      "ionsEntry\022(\n\004opts\030\004 \001(\0132\032.tensorflow.Pro" +
      "fileOptions\022\027\n\017repository_root\030\005 \001(\t\022\022\n\n" +
      "session_id\030\006 \001(\t\022\021\n\thost_name\030\007 \001(\t\032R\n\020T" +
      "oolOptionsEntry\022\013\n\003key\030\001 \001(\t\022-\n\005value\030\002 " +
      "\001(\0132\036.tensorflow.ToolRequestOptions:\0028\001\"" +
      "-\n\017ProfileToolData\022\014\n\004name\030\001 \001(\t\022\014\n\004data" +
      "\030\002 \001(\014\"\366\001\n\017ProfileResponse\022/\n\021computatio" +
      "n_graph\030\002 \003(\0132\024.tensorflow.GraphDef\022-\n\014h" +
      "lo_metadata\030\005 \001(\0132\027.tensorflow.RunMetada",
      "ta\022\025\n\rencoded_trace\030\003 \001(\014\0226\n\nop_profile\030" +
      "\004 \001(\0132\".tensorflow.tpu.op_profile.Profil" +
      "e\022.\n\ttool_data\030\006 \003(\0132\033.tensorflow.Profil" +
      "eToolDataJ\004\010\001\020\0022S\n\013TPUProfiler\022D\n\007Profil" +
      "e\022\032.tensorflow.ProfileRequest\032\033.tensorfl" +
      "ow.ProfileResponse\"\000b\006proto3"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
        new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
          public com.google.protobuf.ExtensionRegistry assignDescriptors(
              com.google.protobuf.Descriptors.FileDescriptor root) {
            descriptor = root;
            return null;
          }
        };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
          org.tensorflow.framework.GraphProtos.getDescriptor(),
          org.tensorflow.framework.ConfigProtos.getDescriptor(),
          tensorflow.tpu.op_profile.OpProfile.getDescriptor(),
        }, assigner);
    internal_static_tensorflow_ProfileOptions_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_tensorflow_ProfileOptions_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_ProfileOptions_descriptor,
        new java.lang.String[] { "IncludeDatasetOps", });
    internal_static_tensorflow_ToolRequestOptions_descriptor =
      getDescriptor().getMessageTypes().get(1);
    internal_static_tensorflow_ToolRequestOptions_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_ToolRequestOptions_descriptor,
        new java.lang.String[] { "OutputFormats", "SaveToRepo", });
    internal_static_tensorflow_ProfileRequest_descriptor =
      getDescriptor().getMessageTypes().get(2);
    internal_static_tensorflow_ProfileRequest_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_ProfileRequest_descriptor,
        new java.lang.String[] { "DurationMs", "MaxEvents", "Tools", "ToolOptions", "Opts", "RepositoryRoot", "SessionId", "HostName", });
    internal_static_tensorflow_ProfileRequest_ToolOptionsEntry_descriptor =
      internal_static_tensorflow_ProfileRequest_descriptor.getNestedTypes().get(0);
    internal_static_tensorflow_ProfileRequest_ToolOptionsEntry_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_ProfileRequest_ToolOptionsEntry_descriptor,
        new java.lang.String[] { "Key", "Value", });
    internal_static_tensorflow_ProfileToolData_descriptor =
      getDescriptor().getMessageTypes().get(3);
    internal_static_tensorflow_ProfileToolData_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_ProfileToolData_descriptor,
        new java.lang.String[] { "Name", "Data", });
    internal_static_tensorflow_ProfileResponse_descriptor =
      getDescriptor().getMessageTypes().get(4);
    internal_static_tensorflow_ProfileResponse_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_ProfileResponse_descriptor,
        new java.lang.String[] { "ComputationGraph", "HloMetadata", "EncodedTrace", "OpProfile", "ToolData", });
    org.tensorflow.framework.GraphProtos.getDescriptor();
    org.tensorflow.framework.ConfigProtos.getDescriptor();
    tensorflow.tpu.op_profile.OpProfile.getDescriptor();
  }

  // @@protoc_insertion_point(outer_class_scope)
}
