// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/core/protobuf/config.proto

package org.tensorflow.proto.framework;

/**
 * Protobuf type {@code tensorflow.GraphOptions}
 */
public  final class GraphOptions extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.GraphOptions)
    GraphOptionsOrBuilder {
private static final long serialVersionUID = 0L;
  // Use GraphOptions.newBuilder() to construct.
  private GraphOptions(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private GraphOptions() {
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(
      UnusedPrivateParameter unused) {
    return new GraphOptions();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private GraphOptions(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 16: {

            enableRecvScheduling_ = input.readBool();
            break;
          }
          case 26: {
            org.tensorflow.proto.framework.OptimizerOptions.Builder subBuilder = null;
            if (optimizerOptions_ != null) {
              subBuilder = optimizerOptions_.toBuilder();
            }
            optimizerOptions_ = input.readMessage(org.tensorflow.proto.framework.OptimizerOptions.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(optimizerOptions_);
              optimizerOptions_ = subBuilder.buildPartial();
            }

            break;
          }
          case 32: {

            buildCostModel_ = input.readInt64();
            break;
          }
          case 40: {

            inferShapes_ = input.readBool();
            break;
          }
          case 48: {

            placePrunedGraph_ = input.readBool();
            break;
          }
          case 56: {

            enableBfloat16Sendrecv_ = input.readBool();
            break;
          }
          case 64: {

            timelineStep_ = input.readInt32();
            break;
          }
          case 72: {

            buildCostModelAfter_ = input.readInt64();
            break;
          }
          case 82: {
            org.tensorflow.proto.framework.RewriterConfig.Builder subBuilder = null;
            if (rewriteOptions_ != null) {
              subBuilder = rewriteOptions_.toBuilder();
            }
            rewriteOptions_ = input.readMessage(org.tensorflow.proto.framework.RewriterConfig.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(rewriteOptions_);
              rewriteOptions_ = subBuilder.buildPartial();
            }

            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            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 {
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GraphOptions_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GraphOptions_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.proto.framework.GraphOptions.class, org.tensorflow.proto.framework.GraphOptions.Builder.class);
  }

  public static final int ENABLE_RECV_SCHEDULING_FIELD_NUMBER = 2;
  private boolean enableRecvScheduling_;
  /**
   * <pre>
   * If true, use control flow to schedule the activation of Recv nodes.
   * (Currently ignored.)
   * </pre>
   *
   * <code>bool enable_recv_scheduling = 2;</code>
   */
  public boolean getEnableRecvScheduling() {
    return enableRecvScheduling_;
  }

  public static final int OPTIMIZER_OPTIONS_FIELD_NUMBER = 3;
  private org.tensorflow.proto.framework.OptimizerOptions optimizerOptions_;
  /**
   * <pre>
   * Options controlling how graph is optimized.
   * </pre>
   *
   * <code>.tensorflow.OptimizerOptions optimizer_options = 3;</code>
   */
  public boolean hasOptimizerOptions() {
    return optimizerOptions_ != null;
  }
  /**
   * <pre>
   * Options controlling how graph is optimized.
   * </pre>
   *
   * <code>.tensorflow.OptimizerOptions optimizer_options = 3;</code>
   */
  public org.tensorflow.proto.framework.OptimizerOptions getOptimizerOptions() {
    return optimizerOptions_ == null ? org.tensorflow.proto.framework.OptimizerOptions.getDefaultInstance() : optimizerOptions_;
  }
  /**
   * <pre>
   * Options controlling how graph is optimized.
   * </pre>
   *
   * <code>.tensorflow.OptimizerOptions optimizer_options = 3;</code>
   */
  public org.tensorflow.proto.framework.OptimizerOptionsOrBuilder getOptimizerOptionsOrBuilder() {
    return getOptimizerOptions();
  }

  public static final int BUILD_COST_MODEL_FIELD_NUMBER = 4;
  private long buildCostModel_;
  /**
   * <pre>
   * The number of steps to run before returning a cost model detailing
   * the memory usage and performance of each node of the graph. 0 means
   * no cost model.
   * </pre>
   *
   * <code>int64 build_cost_model = 4;</code>
   */
  public long getBuildCostModel() {
    return buildCostModel_;
  }

  public static final int BUILD_COST_MODEL_AFTER_FIELD_NUMBER = 9;
  private long buildCostModelAfter_;
  /**
   * <pre>
   * The number of steps to skip before collecting statistics for the
   * cost model.
   * </pre>
   *
   * <code>int64 build_cost_model_after = 9;</code>
   */
  public long getBuildCostModelAfter() {
    return buildCostModelAfter_;
  }

  public static final int INFER_SHAPES_FIELD_NUMBER = 5;
  private boolean inferShapes_;
  /**
   * <pre>
   * Annotate each Node with Op output shape data, to the extent it can
   * be statically inferred.
   * </pre>
   *
   * <code>bool infer_shapes = 5;</code>
   */
  public boolean getInferShapes() {
    return inferShapes_;
  }

  public static final int PLACE_PRUNED_GRAPH_FIELD_NUMBER = 6;
  private boolean placePrunedGraph_;
  /**
   * <pre>
   * Only place the subgraphs that are run, rather than the entire graph.
   * This is useful for interactive graph building, where one might
   * produce graphs that cannot be placed during the debugging
   * process.  In particular, it allows the client to continue work in
   * a session after adding a node to a graph whose placement
   * constraints are unsatisfiable.
   * </pre>
   *
   * <code>bool place_pruned_graph = 6;</code>
   */
  public boolean getPlacePrunedGraph() {
    return placePrunedGraph_;
  }

  public static final int ENABLE_BFLOAT16_SENDRECV_FIELD_NUMBER = 7;
  private boolean enableBfloat16Sendrecv_;
  /**
   * <pre>
   * If true, transfer float values between processes as bfloat16.
   * </pre>
   *
   * <code>bool enable_bfloat16_sendrecv = 7;</code>
   */
  public boolean getEnableBfloat16Sendrecv() {
    return enableBfloat16Sendrecv_;
  }

  public static final int TIMELINE_STEP_FIELD_NUMBER = 8;
  private int timelineStep_;
  /**
   * <pre>
   * If &gt; 0, record a timeline every this many steps.
   * EXPERIMENTAL: This currently has no effect in MasterSession.
   * </pre>
   *
   * <code>int32 timeline_step = 8;</code>
   */
  public int getTimelineStep() {
    return timelineStep_;
  }

  public static final int REWRITE_OPTIONS_FIELD_NUMBER = 10;
  private org.tensorflow.proto.framework.RewriterConfig rewriteOptions_;
  /**
   * <pre>
   * Options that control the type and amount of graph rewriting.
   * Not currently configurable via the public Python API (i.e. there is no API
   * stability guarantee if you import RewriterConfig explicitly).
   * </pre>
   *
   * <code>.tensorflow.RewriterConfig rewrite_options = 10;</code>
   */
  public boolean hasRewriteOptions() {
    return rewriteOptions_ != null;
  }
  /**
   * <pre>
   * Options that control the type and amount of graph rewriting.
   * Not currently configurable via the public Python API (i.e. there is no API
   * stability guarantee if you import RewriterConfig explicitly).
   * </pre>
   *
   * <code>.tensorflow.RewriterConfig rewrite_options = 10;</code>
   */
  public org.tensorflow.proto.framework.RewriterConfig getRewriteOptions() {
    return rewriteOptions_ == null ? org.tensorflow.proto.framework.RewriterConfig.getDefaultInstance() : rewriteOptions_;
  }
  /**
   * <pre>
   * Options that control the type and amount of graph rewriting.
   * Not currently configurable via the public Python API (i.e. there is no API
   * stability guarantee if you import RewriterConfig explicitly).
   * </pre>
   *
   * <code>.tensorflow.RewriterConfig rewrite_options = 10;</code>
   */
  public org.tensorflow.proto.framework.RewriterConfigOrBuilder getRewriteOptionsOrBuilder() {
    return getRewriteOptions();
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (enableRecvScheduling_ != false) {
      output.writeBool(2, enableRecvScheduling_);
    }
    if (optimizerOptions_ != null) {
      output.writeMessage(3, getOptimizerOptions());
    }
    if (buildCostModel_ != 0L) {
      output.writeInt64(4, buildCostModel_);
    }
    if (inferShapes_ != false) {
      output.writeBool(5, inferShapes_);
    }
    if (placePrunedGraph_ != false) {
      output.writeBool(6, placePrunedGraph_);
    }
    if (enableBfloat16Sendrecv_ != false) {
      output.writeBool(7, enableBfloat16Sendrecv_);
    }
    if (timelineStep_ != 0) {
      output.writeInt32(8, timelineStep_);
    }
    if (buildCostModelAfter_ != 0L) {
      output.writeInt64(9, buildCostModelAfter_);
    }
    if (rewriteOptions_ != null) {
      output.writeMessage(10, getRewriteOptions());
    }
    unknownFields.writeTo(output);
  }

  @java.lang.Override
  public int getSerializedSize() {
    int size = memoizedSize;
    if (size != -1) return size;

    size = 0;
    if (enableRecvScheduling_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(2, enableRecvScheduling_);
    }
    if (optimizerOptions_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, getOptimizerOptions());
    }
    if (buildCostModel_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(4, buildCostModel_);
    }
    if (inferShapes_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(5, inferShapes_);
    }
    if (placePrunedGraph_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(6, placePrunedGraph_);
    }
    if (enableBfloat16Sendrecv_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(7, enableBfloat16Sendrecv_);
    }
    if (timelineStep_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(8, timelineStep_);
    }
    if (buildCostModelAfter_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(9, buildCostModelAfter_);
    }
    if (rewriteOptions_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(10, getRewriteOptions());
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof org.tensorflow.proto.framework.GraphOptions)) {
      return super.equals(obj);
    }
    org.tensorflow.proto.framework.GraphOptions other = (org.tensorflow.proto.framework.GraphOptions) obj;

    if (getEnableRecvScheduling()
        != other.getEnableRecvScheduling()) return false;
    if (hasOptimizerOptions() != other.hasOptimizerOptions()) return false;
    if (hasOptimizerOptions()) {
      if (!getOptimizerOptions()
          .equals(other.getOptimizerOptions())) return false;
    }
    if (getBuildCostModel()
        != other.getBuildCostModel()) return false;
    if (getBuildCostModelAfter()
        != other.getBuildCostModelAfter()) return false;
    if (getInferShapes()
        != other.getInferShapes()) return false;
    if (getPlacePrunedGraph()
        != other.getPlacePrunedGraph()) return false;
    if (getEnableBfloat16Sendrecv()
        != other.getEnableBfloat16Sendrecv()) return false;
    if (getTimelineStep()
        != other.getTimelineStep()) return false;
    if (hasRewriteOptions() != other.hasRewriteOptions()) return false;
    if (hasRewriteOptions()) {
      if (!getRewriteOptions()
          .equals(other.getRewriteOptions())) return false;
    }
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + ENABLE_RECV_SCHEDULING_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getEnableRecvScheduling());
    if (hasOptimizerOptions()) {
      hash = (37 * hash) + OPTIMIZER_OPTIONS_FIELD_NUMBER;
      hash = (53 * hash) + getOptimizerOptions().hashCode();
    }
    hash = (37 * hash) + BUILD_COST_MODEL_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getBuildCostModel());
    hash = (37 * hash) + BUILD_COST_MODEL_AFTER_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getBuildCostModelAfter());
    hash = (37 * hash) + INFER_SHAPES_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getInferShapes());
    hash = (37 * hash) + PLACE_PRUNED_GRAPH_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getPlacePrunedGraph());
    hash = (37 * hash) + ENABLE_BFLOAT16_SENDRECV_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getEnableBfloat16Sendrecv());
    hash = (37 * hash) + TIMELINE_STEP_FIELD_NUMBER;
    hash = (53 * hash) + getTimelineStep();
    if (hasRewriteOptions()) {
      hash = (37 * hash) + REWRITE_OPTIONS_FIELD_NUMBER;
      hash = (53 * hash) + getRewriteOptions().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tensorflow.proto.framework.GraphOptions parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.framework.GraphOptions parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.framework.GraphOptions parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.framework.GraphOptions parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.framework.GraphOptions parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.framework.GraphOptions parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.framework.GraphOptions parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.framework.GraphOptions 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 org.tensorflow.proto.framework.GraphOptions parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.framework.GraphOptions 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 org.tensorflow.proto.framework.GraphOptions parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.framework.GraphOptions parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(org.tensorflow.proto.framework.GraphOptions prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  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.GraphOptions}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.GraphOptions)
      org.tensorflow.proto.framework.GraphOptionsOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GraphOptions_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GraphOptions_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.framework.GraphOptions.class, org.tensorflow.proto.framework.GraphOptions.Builder.class);
    }

    // Construct using org.tensorflow.proto.framework.GraphOptions.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      enableRecvScheduling_ = false;

      if (optimizerOptionsBuilder_ == null) {
        optimizerOptions_ = null;
      } else {
        optimizerOptions_ = null;
        optimizerOptionsBuilder_ = null;
      }
      buildCostModel_ = 0L;

      buildCostModelAfter_ = 0L;

      inferShapes_ = false;

      placePrunedGraph_ = false;

      enableBfloat16Sendrecv_ = false;

      timelineStep_ = 0;

      if (rewriteOptionsBuilder_ == null) {
        rewriteOptions_ = null;
      } else {
        rewriteOptions_ = null;
        rewriteOptionsBuilder_ = null;
      }
      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tensorflow.proto.framework.ConfigProtos.internal_static_tensorflow_GraphOptions_descriptor;
    }

    @java.lang.Override
    public org.tensorflow.proto.framework.GraphOptions getDefaultInstanceForType() {
      return org.tensorflow.proto.framework.GraphOptions.getDefaultInstance();
    }

    @java.lang.Override
    public org.tensorflow.proto.framework.GraphOptions build() {
      org.tensorflow.proto.framework.GraphOptions result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public org.tensorflow.proto.framework.GraphOptions buildPartial() {
      org.tensorflow.proto.framework.GraphOptions result = new org.tensorflow.proto.framework.GraphOptions(this);
      result.enableRecvScheduling_ = enableRecvScheduling_;
      if (optimizerOptionsBuilder_ == null) {
        result.optimizerOptions_ = optimizerOptions_;
      } else {
        result.optimizerOptions_ = optimizerOptionsBuilder_.build();
      }
      result.buildCostModel_ = buildCostModel_;
      result.buildCostModelAfter_ = buildCostModelAfter_;
      result.inferShapes_ = inferShapes_;
      result.placePrunedGraph_ = placePrunedGraph_;
      result.enableBfloat16Sendrecv_ = enableBfloat16Sendrecv_;
      result.timelineStep_ = timelineStep_;
      if (rewriteOptionsBuilder_ == null) {
        result.rewriteOptions_ = rewriteOptions_;
      } else {
        result.rewriteOptions_ = rewriteOptionsBuilder_.build();
      }
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof org.tensorflow.proto.framework.GraphOptions) {
        return mergeFrom((org.tensorflow.proto.framework.GraphOptions)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.proto.framework.GraphOptions other) {
      if (other == org.tensorflow.proto.framework.GraphOptions.getDefaultInstance()) return this;
      if (other.getEnableRecvScheduling() != false) {
        setEnableRecvScheduling(other.getEnableRecvScheduling());
      }
      if (other.hasOptimizerOptions()) {
        mergeOptimizerOptions(other.getOptimizerOptions());
      }
      if (other.getBuildCostModel() != 0L) {
        setBuildCostModel(other.getBuildCostModel());
      }
      if (other.getBuildCostModelAfter() != 0L) {
        setBuildCostModelAfter(other.getBuildCostModelAfter());
      }
      if (other.getInferShapes() != false) {
        setInferShapes(other.getInferShapes());
      }
      if (other.getPlacePrunedGraph() != false) {
        setPlacePrunedGraph(other.getPlacePrunedGraph());
      }
      if (other.getEnableBfloat16Sendrecv() != false) {
        setEnableBfloat16Sendrecv(other.getEnableBfloat16Sendrecv());
      }
      if (other.getTimelineStep() != 0) {
        setTimelineStep(other.getTimelineStep());
      }
      if (other.hasRewriteOptions()) {
        mergeRewriteOptions(other.getRewriteOptions());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

    @java.lang.Override
    public final boolean isInitialized() {
      return true;
    }

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

    private boolean enableRecvScheduling_ ;
    /**
     * <pre>
     * If true, use control flow to schedule the activation of Recv nodes.
     * (Currently ignored.)
     * </pre>
     *
     * <code>bool enable_recv_scheduling = 2;</code>
     */
    public boolean getEnableRecvScheduling() {
      return enableRecvScheduling_;
    }
    /**
     * <pre>
     * If true, use control flow to schedule the activation of Recv nodes.
     * (Currently ignored.)
     * </pre>
     *
     * <code>bool enable_recv_scheduling = 2;</code>
     */
    public Builder setEnableRecvScheduling(boolean value) {
      
      enableRecvScheduling_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * If true, use control flow to schedule the activation of Recv nodes.
     * (Currently ignored.)
     * </pre>
     *
     * <code>bool enable_recv_scheduling = 2;</code>
     */
    public Builder clearEnableRecvScheduling() {
      
      enableRecvScheduling_ = false;
      onChanged();
      return this;
    }

    private org.tensorflow.proto.framework.OptimizerOptions optimizerOptions_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.framework.OptimizerOptions, org.tensorflow.proto.framework.OptimizerOptions.Builder, org.tensorflow.proto.framework.OptimizerOptionsOrBuilder> optimizerOptionsBuilder_;
    /**
     * <pre>
     * Options controlling how graph is optimized.
     * </pre>
     *
     * <code>.tensorflow.OptimizerOptions optimizer_options = 3;</code>
     */
    public boolean hasOptimizerOptions() {
      return optimizerOptionsBuilder_ != null || optimizerOptions_ != null;
    }
    /**
     * <pre>
     * Options controlling how graph is optimized.
     * </pre>
     *
     * <code>.tensorflow.OptimizerOptions optimizer_options = 3;</code>
     */
    public org.tensorflow.proto.framework.OptimizerOptions getOptimizerOptions() {
      if (optimizerOptionsBuilder_ == null) {
        return optimizerOptions_ == null ? org.tensorflow.proto.framework.OptimizerOptions.getDefaultInstance() : optimizerOptions_;
      } else {
        return optimizerOptionsBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Options controlling how graph is optimized.
     * </pre>
     *
     * <code>.tensorflow.OptimizerOptions optimizer_options = 3;</code>
     */
    public Builder setOptimizerOptions(org.tensorflow.proto.framework.OptimizerOptions value) {
      if (optimizerOptionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        optimizerOptions_ = value;
        onChanged();
      } else {
        optimizerOptionsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Options controlling how graph is optimized.
     * </pre>
     *
     * <code>.tensorflow.OptimizerOptions optimizer_options = 3;</code>
     */
    public Builder setOptimizerOptions(
        org.tensorflow.proto.framework.OptimizerOptions.Builder builderForValue) {
      if (optimizerOptionsBuilder_ == null) {
        optimizerOptions_ = builderForValue.build();
        onChanged();
      } else {
        optimizerOptionsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Options controlling how graph is optimized.
     * </pre>
     *
     * <code>.tensorflow.OptimizerOptions optimizer_options = 3;</code>
     */
    public Builder mergeOptimizerOptions(org.tensorflow.proto.framework.OptimizerOptions value) {
      if (optimizerOptionsBuilder_ == null) {
        if (optimizerOptions_ != null) {
          optimizerOptions_ =
            org.tensorflow.proto.framework.OptimizerOptions.newBuilder(optimizerOptions_).mergeFrom(value).buildPartial();
        } else {
          optimizerOptions_ = value;
        }
        onChanged();
      } else {
        optimizerOptionsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Options controlling how graph is optimized.
     * </pre>
     *
     * <code>.tensorflow.OptimizerOptions optimizer_options = 3;</code>
     */
    public Builder clearOptimizerOptions() {
      if (optimizerOptionsBuilder_ == null) {
        optimizerOptions_ = null;
        onChanged();
      } else {
        optimizerOptions_ = null;
        optimizerOptionsBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Options controlling how graph is optimized.
     * </pre>
     *
     * <code>.tensorflow.OptimizerOptions optimizer_options = 3;</code>
     */
    public org.tensorflow.proto.framework.OptimizerOptions.Builder getOptimizerOptionsBuilder() {
      
      onChanged();
      return getOptimizerOptionsFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Options controlling how graph is optimized.
     * </pre>
     *
     * <code>.tensorflow.OptimizerOptions optimizer_options = 3;</code>
     */
    public org.tensorflow.proto.framework.OptimizerOptionsOrBuilder getOptimizerOptionsOrBuilder() {
      if (optimizerOptionsBuilder_ != null) {
        return optimizerOptionsBuilder_.getMessageOrBuilder();
      } else {
        return optimizerOptions_ == null ?
            org.tensorflow.proto.framework.OptimizerOptions.getDefaultInstance() : optimizerOptions_;
      }
    }
    /**
     * <pre>
     * Options controlling how graph is optimized.
     * </pre>
     *
     * <code>.tensorflow.OptimizerOptions optimizer_options = 3;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.framework.OptimizerOptions, org.tensorflow.proto.framework.OptimizerOptions.Builder, org.tensorflow.proto.framework.OptimizerOptionsOrBuilder> 
        getOptimizerOptionsFieldBuilder() {
      if (optimizerOptionsBuilder_ == null) {
        optimizerOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tensorflow.proto.framework.OptimizerOptions, org.tensorflow.proto.framework.OptimizerOptions.Builder, org.tensorflow.proto.framework.OptimizerOptionsOrBuilder>(
                getOptimizerOptions(),
                getParentForChildren(),
                isClean());
        optimizerOptions_ = null;
      }
      return optimizerOptionsBuilder_;
    }

    private long buildCostModel_ ;
    /**
     * <pre>
     * The number of steps to run before returning a cost model detailing
     * the memory usage and performance of each node of the graph. 0 means
     * no cost model.
     * </pre>
     *
     * <code>int64 build_cost_model = 4;</code>
     */
    public long getBuildCostModel() {
      return buildCostModel_;
    }
    /**
     * <pre>
     * The number of steps to run before returning a cost model detailing
     * the memory usage and performance of each node of the graph. 0 means
     * no cost model.
     * </pre>
     *
     * <code>int64 build_cost_model = 4;</code>
     */
    public Builder setBuildCostModel(long value) {
      
      buildCostModel_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The number of steps to run before returning a cost model detailing
     * the memory usage and performance of each node of the graph. 0 means
     * no cost model.
     * </pre>
     *
     * <code>int64 build_cost_model = 4;</code>
     */
    public Builder clearBuildCostModel() {
      
      buildCostModel_ = 0L;
      onChanged();
      return this;
    }

    private long buildCostModelAfter_ ;
    /**
     * <pre>
     * The number of steps to skip before collecting statistics for the
     * cost model.
     * </pre>
     *
     * <code>int64 build_cost_model_after = 9;</code>
     */
    public long getBuildCostModelAfter() {
      return buildCostModelAfter_;
    }
    /**
     * <pre>
     * The number of steps to skip before collecting statistics for the
     * cost model.
     * </pre>
     *
     * <code>int64 build_cost_model_after = 9;</code>
     */
    public Builder setBuildCostModelAfter(long value) {
      
      buildCostModelAfter_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The number of steps to skip before collecting statistics for the
     * cost model.
     * </pre>
     *
     * <code>int64 build_cost_model_after = 9;</code>
     */
    public Builder clearBuildCostModelAfter() {
      
      buildCostModelAfter_ = 0L;
      onChanged();
      return this;
    }

    private boolean inferShapes_ ;
    /**
     * <pre>
     * Annotate each Node with Op output shape data, to the extent it can
     * be statically inferred.
     * </pre>
     *
     * <code>bool infer_shapes = 5;</code>
     */
    public boolean getInferShapes() {
      return inferShapes_;
    }
    /**
     * <pre>
     * Annotate each Node with Op output shape data, to the extent it can
     * be statically inferred.
     * </pre>
     *
     * <code>bool infer_shapes = 5;</code>
     */
    public Builder setInferShapes(boolean value) {
      
      inferShapes_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Annotate each Node with Op output shape data, to the extent it can
     * be statically inferred.
     * </pre>
     *
     * <code>bool infer_shapes = 5;</code>
     */
    public Builder clearInferShapes() {
      
      inferShapes_ = false;
      onChanged();
      return this;
    }

    private boolean placePrunedGraph_ ;
    /**
     * <pre>
     * Only place the subgraphs that are run, rather than the entire graph.
     * This is useful for interactive graph building, where one might
     * produce graphs that cannot be placed during the debugging
     * process.  In particular, it allows the client to continue work in
     * a session after adding a node to a graph whose placement
     * constraints are unsatisfiable.
     * </pre>
     *
     * <code>bool place_pruned_graph = 6;</code>
     */
    public boolean getPlacePrunedGraph() {
      return placePrunedGraph_;
    }
    /**
     * <pre>
     * Only place the subgraphs that are run, rather than the entire graph.
     * This is useful for interactive graph building, where one might
     * produce graphs that cannot be placed during the debugging
     * process.  In particular, it allows the client to continue work in
     * a session after adding a node to a graph whose placement
     * constraints are unsatisfiable.
     * </pre>
     *
     * <code>bool place_pruned_graph = 6;</code>
     */
    public Builder setPlacePrunedGraph(boolean value) {
      
      placePrunedGraph_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Only place the subgraphs that are run, rather than the entire graph.
     * This is useful for interactive graph building, where one might
     * produce graphs that cannot be placed during the debugging
     * process.  In particular, it allows the client to continue work in
     * a session after adding a node to a graph whose placement
     * constraints are unsatisfiable.
     * </pre>
     *
     * <code>bool place_pruned_graph = 6;</code>
     */
    public Builder clearPlacePrunedGraph() {
      
      placePrunedGraph_ = false;
      onChanged();
      return this;
    }

    private boolean enableBfloat16Sendrecv_ ;
    /**
     * <pre>
     * If true, transfer float values between processes as bfloat16.
     * </pre>
     *
     * <code>bool enable_bfloat16_sendrecv = 7;</code>
     */
    public boolean getEnableBfloat16Sendrecv() {
      return enableBfloat16Sendrecv_;
    }
    /**
     * <pre>
     * If true, transfer float values between processes as bfloat16.
     * </pre>
     *
     * <code>bool enable_bfloat16_sendrecv = 7;</code>
     */
    public Builder setEnableBfloat16Sendrecv(boolean value) {
      
      enableBfloat16Sendrecv_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * If true, transfer float values between processes as bfloat16.
     * </pre>
     *
     * <code>bool enable_bfloat16_sendrecv = 7;</code>
     */
    public Builder clearEnableBfloat16Sendrecv() {
      
      enableBfloat16Sendrecv_ = false;
      onChanged();
      return this;
    }

    private int timelineStep_ ;
    /**
     * <pre>
     * If &gt; 0, record a timeline every this many steps.
     * EXPERIMENTAL: This currently has no effect in MasterSession.
     * </pre>
     *
     * <code>int32 timeline_step = 8;</code>
     */
    public int getTimelineStep() {
      return timelineStep_;
    }
    /**
     * <pre>
     * If &gt; 0, record a timeline every this many steps.
     * EXPERIMENTAL: This currently has no effect in MasterSession.
     * </pre>
     *
     * <code>int32 timeline_step = 8;</code>
     */
    public Builder setTimelineStep(int value) {
      
      timelineStep_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * If &gt; 0, record a timeline every this many steps.
     * EXPERIMENTAL: This currently has no effect in MasterSession.
     * </pre>
     *
     * <code>int32 timeline_step = 8;</code>
     */
    public Builder clearTimelineStep() {
      
      timelineStep_ = 0;
      onChanged();
      return this;
    }

    private org.tensorflow.proto.framework.RewriterConfig rewriteOptions_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.framework.RewriterConfig, org.tensorflow.proto.framework.RewriterConfig.Builder, org.tensorflow.proto.framework.RewriterConfigOrBuilder> rewriteOptionsBuilder_;
    /**
     * <pre>
     * Options that control the type and amount of graph rewriting.
     * Not currently configurable via the public Python API (i.e. there is no API
     * stability guarantee if you import RewriterConfig explicitly).
     * </pre>
     *
     * <code>.tensorflow.RewriterConfig rewrite_options = 10;</code>
     */
    public boolean hasRewriteOptions() {
      return rewriteOptionsBuilder_ != null || rewriteOptions_ != null;
    }
    /**
     * <pre>
     * Options that control the type and amount of graph rewriting.
     * Not currently configurable via the public Python API (i.e. there is no API
     * stability guarantee if you import RewriterConfig explicitly).
     * </pre>
     *
     * <code>.tensorflow.RewriterConfig rewrite_options = 10;</code>
     */
    public org.tensorflow.proto.framework.RewriterConfig getRewriteOptions() {
      if (rewriteOptionsBuilder_ == null) {
        return rewriteOptions_ == null ? org.tensorflow.proto.framework.RewriterConfig.getDefaultInstance() : rewriteOptions_;
      } else {
        return rewriteOptionsBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Options that control the type and amount of graph rewriting.
     * Not currently configurable via the public Python API (i.e. there is no API
     * stability guarantee if you import RewriterConfig explicitly).
     * </pre>
     *
     * <code>.tensorflow.RewriterConfig rewrite_options = 10;</code>
     */
    public Builder setRewriteOptions(org.tensorflow.proto.framework.RewriterConfig value) {
      if (rewriteOptionsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        rewriteOptions_ = value;
        onChanged();
      } else {
        rewriteOptionsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Options that control the type and amount of graph rewriting.
     * Not currently configurable via the public Python API (i.e. there is no API
     * stability guarantee if you import RewriterConfig explicitly).
     * </pre>
     *
     * <code>.tensorflow.RewriterConfig rewrite_options = 10;</code>
     */
    public Builder setRewriteOptions(
        org.tensorflow.proto.framework.RewriterConfig.Builder builderForValue) {
      if (rewriteOptionsBuilder_ == null) {
        rewriteOptions_ = builderForValue.build();
        onChanged();
      } else {
        rewriteOptionsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Options that control the type and amount of graph rewriting.
     * Not currently configurable via the public Python API (i.e. there is no API
     * stability guarantee if you import RewriterConfig explicitly).
     * </pre>
     *
     * <code>.tensorflow.RewriterConfig rewrite_options = 10;</code>
     */
    public Builder mergeRewriteOptions(org.tensorflow.proto.framework.RewriterConfig value) {
      if (rewriteOptionsBuilder_ == null) {
        if (rewriteOptions_ != null) {
          rewriteOptions_ =
            org.tensorflow.proto.framework.RewriterConfig.newBuilder(rewriteOptions_).mergeFrom(value).buildPartial();
        } else {
          rewriteOptions_ = value;
        }
        onChanged();
      } else {
        rewriteOptionsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Options that control the type and amount of graph rewriting.
     * Not currently configurable via the public Python API (i.e. there is no API
     * stability guarantee if you import RewriterConfig explicitly).
     * </pre>
     *
     * <code>.tensorflow.RewriterConfig rewrite_options = 10;</code>
     */
    public Builder clearRewriteOptions() {
      if (rewriteOptionsBuilder_ == null) {
        rewriteOptions_ = null;
        onChanged();
      } else {
        rewriteOptions_ = null;
        rewriteOptionsBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Options that control the type and amount of graph rewriting.
     * Not currently configurable via the public Python API (i.e. there is no API
     * stability guarantee if you import RewriterConfig explicitly).
     * </pre>
     *
     * <code>.tensorflow.RewriterConfig rewrite_options = 10;</code>
     */
    public org.tensorflow.proto.framework.RewriterConfig.Builder getRewriteOptionsBuilder() {
      
      onChanged();
      return getRewriteOptionsFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Options that control the type and amount of graph rewriting.
     * Not currently configurable via the public Python API (i.e. there is no API
     * stability guarantee if you import RewriterConfig explicitly).
     * </pre>
     *
     * <code>.tensorflow.RewriterConfig rewrite_options = 10;</code>
     */
    public org.tensorflow.proto.framework.RewriterConfigOrBuilder getRewriteOptionsOrBuilder() {
      if (rewriteOptionsBuilder_ != null) {
        return rewriteOptionsBuilder_.getMessageOrBuilder();
      } else {
        return rewriteOptions_ == null ?
            org.tensorflow.proto.framework.RewriterConfig.getDefaultInstance() : rewriteOptions_;
      }
    }
    /**
     * <pre>
     * Options that control the type and amount of graph rewriting.
     * Not currently configurable via the public Python API (i.e. there is no API
     * stability guarantee if you import RewriterConfig explicitly).
     * </pre>
     *
     * <code>.tensorflow.RewriterConfig rewrite_options = 10;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.framework.RewriterConfig, org.tensorflow.proto.framework.RewriterConfig.Builder, org.tensorflow.proto.framework.RewriterConfigOrBuilder> 
        getRewriteOptionsFieldBuilder() {
      if (rewriteOptionsBuilder_ == null) {
        rewriteOptionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tensorflow.proto.framework.RewriterConfig, org.tensorflow.proto.framework.RewriterConfig.Builder, org.tensorflow.proto.framework.RewriterConfigOrBuilder>(
                getRewriteOptions(),
                getParentForChildren(),
                isClean());
        rewriteOptions_ = null;
      }
      return rewriteOptionsBuilder_;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }


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

  // @@protoc_insertion_point(class_scope:tensorflow.GraphOptions)
  private static final org.tensorflow.proto.framework.GraphOptions DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new org.tensorflow.proto.framework.GraphOptions();
  }

  public static org.tensorflow.proto.framework.GraphOptions getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public org.tensorflow.proto.framework.GraphOptions getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}

