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

package org.tensorflow.proto.util;

/**
 * <pre>
 * Data relating to an execution of a Graph (e.g., an eager execution of a
 * FuncGraph).
 * The values of the intermediate tensors computed in the graph are recorded
 * in this proto. A graph execution may correspond to one or more pieces of
 * `GraphExecutionTrace`, depending on whether the instrumented tensor values
 * are summarized in an aggregated or separate fashion.
 * </pre>
 *
 * Protobuf type {@code tensorflow.GraphExecutionTrace}
 */
public  final class GraphExecutionTrace extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.GraphExecutionTrace)
    GraphExecutionTraceOrBuilder {
private static final long serialVersionUID = 0L;
  // Use GraphExecutionTrace.newBuilder() to construct.
  private GraphExecutionTrace(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private GraphExecutionTrace() {
    tfdbgContextId_ = "";
    opName_ = "";
    tensorDebugMode_ = 0;
    deviceName_ = "";
  }

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private GraphExecutionTrace(
      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 10: {
            java.lang.String s = input.readStringRequireUtf8();

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

            opName_ = s;
            break;
          }
          case 24: {

            outputSlot_ = input.readInt32();
            break;
          }
          case 32: {
            int rawValue = input.readEnum();

            tensorDebugMode_ = rawValue;
            break;
          }
          case 42: {
            org.tensorflow.proto.framework.TensorProto.Builder subBuilder = null;
            if (tensorProto_ != null) {
              subBuilder = tensorProto_.toBuilder();
            }
            tensorProto_ = input.readMessage(org.tensorflow.proto.framework.TensorProto.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(tensorProto_);
              tensorProto_ = subBuilder.buildPartial();
            }

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

            deviceName_ = s;
            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.util.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.proto.util.GraphExecutionTrace.class, org.tensorflow.proto.util.GraphExecutionTrace.Builder.class);
  }

  public static final int TFDBG_CONTEXT_ID_FIELD_NUMBER = 1;
  private volatile java.lang.Object tfdbgContextId_;
  /**
   * <pre>
   * Unique ID of the context that the executed op(s) belong to (e.g., a
   * compiled concrete tf.function).
   * </pre>
   *
   * <code>string tfdbg_context_id = 1;</code>
   */
  public java.lang.String getTfdbgContextId() {
    java.lang.Object ref = tfdbgContextId_;
    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();
      tfdbgContextId_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Unique ID of the context that the executed op(s) belong to (e.g., a
   * compiled concrete tf.function).
   * </pre>
   *
   * <code>string tfdbg_context_id = 1;</code>
   */
  public com.google.protobuf.ByteString
      getTfdbgContextIdBytes() {
    java.lang.Object ref = tfdbgContextId_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      tfdbgContextId_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int OP_NAME_FIELD_NUMBER = 2;
  private volatile java.lang.Object opName_;
  /**
   * <pre>
   * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
   * level).
   * </pre>
   *
   * <code>string op_name = 2;</code>
   */
  public java.lang.String getOpName() {
    java.lang.Object ref = opName_;
    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();
      opName_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
   * level).
   * </pre>
   *
   * <code>string op_name = 2;</code>
   */
  public com.google.protobuf.ByteString
      getOpNameBytes() {
    java.lang.Object ref = opName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      opName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int OUTPUT_SLOT_FIELD_NUMBER = 3;
  private int outputSlot_;
  /**
   * <pre>
   * Output slot of the tensor (applicable only in the case of the `FULL_TENSOR`
   * trace level).
   * </pre>
   *
   * <code>int32 output_slot = 3;</code>
   */
  public int getOutputSlot() {
    return outputSlot_;
  }

  public static final int TENSOR_DEBUG_MODE_FIELD_NUMBER = 4;
  private int tensorDebugMode_;
  /**
   * <pre>
   * Type of the tensor value encapsulated in this proto.
   * </pre>
   *
   * <code>.tensorflow.TensorDebugMode tensor_debug_mode = 4;</code>
   */
  public int getTensorDebugModeValue() {
    return tensorDebugMode_;
  }
  /**
   * <pre>
   * Type of the tensor value encapsulated in this proto.
   * </pre>
   *
   * <code>.tensorflow.TensorDebugMode tensor_debug_mode = 4;</code>
   */
  public org.tensorflow.proto.util.TensorDebugMode getTensorDebugMode() {
    @SuppressWarnings("deprecation")
    org.tensorflow.proto.util.TensorDebugMode result = org.tensorflow.proto.util.TensorDebugMode.valueOf(tensorDebugMode_);
    return result == null ? org.tensorflow.proto.util.TensorDebugMode.UNRECOGNIZED : result;
  }

  public static final int TENSOR_PROTO_FIELD_NUMBER = 5;
  private org.tensorflow.proto.framework.TensorProto tensorProto_;
  /**
   * <pre>
   * Tensor value in the type described by `tensor_value_type`.
   * This tensor may summarize the value of a single intermediate op of the
   * graph, or those of multiple intermediate tensors.
   * </pre>
   *
   * <code>.tensorflow.TensorProto tensor_proto = 5;</code>
   */
  public boolean hasTensorProto() {
    return tensorProto_ != null;
  }
  /**
   * <pre>
   * Tensor value in the type described by `tensor_value_type`.
   * This tensor may summarize the value of a single intermediate op of the
   * graph, or those of multiple intermediate tensors.
   * </pre>
   *
   * <code>.tensorflow.TensorProto tensor_proto = 5;</code>
   */
  public org.tensorflow.proto.framework.TensorProto getTensorProto() {
    return tensorProto_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : tensorProto_;
  }
  /**
   * <pre>
   * Tensor value in the type described by `tensor_value_type`.
   * This tensor may summarize the value of a single intermediate op of the
   * graph, or those of multiple intermediate tensors.
   * </pre>
   *
   * <code>.tensorflow.TensorProto tensor_proto = 5;</code>
   */
  public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtoOrBuilder() {
    return getTensorProto();
  }

  public static final int DEVICE_NAME_FIELD_NUMBER = 6;
  private volatile java.lang.Object deviceName_;
  /**
   * <pre>
   * Name of the device that the op belongs to.
   * </pre>
   *
   * <code>string device_name = 6;</code>
   */
  public java.lang.String getDeviceName() {
    java.lang.Object ref = deviceName_;
    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();
      deviceName_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Name of the device that the op belongs to.
   * </pre>
   *
   * <code>string device_name = 6;</code>
   */
  public com.google.protobuf.ByteString
      getDeviceNameBytes() {
    java.lang.Object ref = deviceName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      deviceName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  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 (!getTfdbgContextIdBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, tfdbgContextId_);
    }
    if (!getOpNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, opName_);
    }
    if (outputSlot_ != 0) {
      output.writeInt32(3, outputSlot_);
    }
    if (tensorDebugMode_ != org.tensorflow.proto.util.TensorDebugMode.UNSPECIFIED.getNumber()) {
      output.writeEnum(4, tensorDebugMode_);
    }
    if (tensorProto_ != null) {
      output.writeMessage(5, getTensorProto());
    }
    if (!getDeviceNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 6, deviceName_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getTfdbgContextIdBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, tfdbgContextId_);
    }
    if (!getOpNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, opName_);
    }
    if (outputSlot_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(3, outputSlot_);
    }
    if (tensorDebugMode_ != org.tensorflow.proto.util.TensorDebugMode.UNSPECIFIED.getNumber()) {
      size += com.google.protobuf.CodedOutputStream
        .computeEnumSize(4, tensorDebugMode_);
    }
    if (tensorProto_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getTensorProto());
    }
    if (!getDeviceNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, deviceName_);
    }
    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.util.GraphExecutionTrace)) {
      return super.equals(obj);
    }
    org.tensorflow.proto.util.GraphExecutionTrace other = (org.tensorflow.proto.util.GraphExecutionTrace) obj;

    if (!getTfdbgContextId()
        .equals(other.getTfdbgContextId())) return false;
    if (!getOpName()
        .equals(other.getOpName())) return false;
    if (getOutputSlot()
        != other.getOutputSlot()) return false;
    if (tensorDebugMode_ != other.tensorDebugMode_) return false;
    if (hasTensorProto() != other.hasTensorProto()) return false;
    if (hasTensorProto()) {
      if (!getTensorProto()
          .equals(other.getTensorProto())) return false;
    }
    if (!getDeviceName()
        .equals(other.getDeviceName())) 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) + TFDBG_CONTEXT_ID_FIELD_NUMBER;
    hash = (53 * hash) + getTfdbgContextId().hashCode();
    hash = (37 * hash) + OP_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getOpName().hashCode();
    hash = (37 * hash) + OUTPUT_SLOT_FIELD_NUMBER;
    hash = (53 * hash) + getOutputSlot();
    hash = (37 * hash) + TENSOR_DEBUG_MODE_FIELD_NUMBER;
    hash = (53 * hash) + tensorDebugMode_;
    if (hasTensorProto()) {
      hash = (37 * hash) + TENSOR_PROTO_FIELD_NUMBER;
      hash = (53 * hash) + getTensorProto().hashCode();
    }
    hash = (37 * hash) + DEVICE_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getDeviceName().hashCode();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tensorflow.proto.util.GraphExecutionTrace parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.util.GraphExecutionTrace 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.util.GraphExecutionTrace parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.util.GraphExecutionTrace 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.util.GraphExecutionTrace parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.util.GraphExecutionTrace parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.util.GraphExecutionTrace parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.util.GraphExecutionTrace 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.util.GraphExecutionTrace parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.util.GraphExecutionTrace 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.util.GraphExecutionTrace parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.util.GraphExecutionTrace 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.util.GraphExecutionTrace 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;
  }
  /**
   * <pre>
   * Data relating to an execution of a Graph (e.g., an eager execution of a
   * FuncGraph).
   * The values of the intermediate tensors computed in the graph are recorded
   * in this proto. A graph execution may correspond to one or more pieces of
   * `GraphExecutionTrace`, depending on whether the instrumented tensor values
   * are summarized in an aggregated or separate fashion.
   * </pre>
   *
   * Protobuf type {@code tensorflow.GraphExecutionTrace}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.GraphExecutionTrace)
      org.tensorflow.proto.util.GraphExecutionTraceOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.util.GraphExecutionTrace.class, org.tensorflow.proto.util.GraphExecutionTrace.Builder.class);
    }

    // Construct using org.tensorflow.proto.util.GraphExecutionTrace.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();
      tfdbgContextId_ = "";

      opName_ = "";

      outputSlot_ = 0;

      tensorDebugMode_ = 0;

      if (tensorProtoBuilder_ == null) {
        tensorProto_ = null;
      } else {
        tensorProto_ = null;
        tensorProtoBuilder_ = null;
      }
      deviceName_ = "";

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return org.tensorflow.proto.util.DebugEventProtos.internal_static_tensorflow_GraphExecutionTrace_descriptor;
    }

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

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

    @java.lang.Override
    public org.tensorflow.proto.util.GraphExecutionTrace buildPartial() {
      org.tensorflow.proto.util.GraphExecutionTrace result = new org.tensorflow.proto.util.GraphExecutionTrace(this);
      result.tfdbgContextId_ = tfdbgContextId_;
      result.opName_ = opName_;
      result.outputSlot_ = outputSlot_;
      result.tensorDebugMode_ = tensorDebugMode_;
      if (tensorProtoBuilder_ == null) {
        result.tensorProto_ = tensorProto_;
      } else {
        result.tensorProto_ = tensorProtoBuilder_.build();
      }
      result.deviceName_ = deviceName_;
      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.util.GraphExecutionTrace) {
        return mergeFrom((org.tensorflow.proto.util.GraphExecutionTrace)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.proto.util.GraphExecutionTrace other) {
      if (other == org.tensorflow.proto.util.GraphExecutionTrace.getDefaultInstance()) return this;
      if (!other.getTfdbgContextId().isEmpty()) {
        tfdbgContextId_ = other.tfdbgContextId_;
        onChanged();
      }
      if (!other.getOpName().isEmpty()) {
        opName_ = other.opName_;
        onChanged();
      }
      if (other.getOutputSlot() != 0) {
        setOutputSlot(other.getOutputSlot());
      }
      if (other.tensorDebugMode_ != 0) {
        setTensorDebugModeValue(other.getTensorDebugModeValue());
      }
      if (other.hasTensorProto()) {
        mergeTensorProto(other.getTensorProto());
      }
      if (!other.getDeviceName().isEmpty()) {
        deviceName_ = other.deviceName_;
        onChanged();
      }
      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.util.GraphExecutionTrace parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.proto.util.GraphExecutionTrace) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private java.lang.Object tfdbgContextId_ = "";
    /**
     * <pre>
     * Unique ID of the context that the executed op(s) belong to (e.g., a
     * compiled concrete tf.function).
     * </pre>
     *
     * <code>string tfdbg_context_id = 1;</code>
     */
    public java.lang.String getTfdbgContextId() {
      java.lang.Object ref = tfdbgContextId_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        tfdbgContextId_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Unique ID of the context that the executed op(s) belong to (e.g., a
     * compiled concrete tf.function).
     * </pre>
     *
     * <code>string tfdbg_context_id = 1;</code>
     */
    public com.google.protobuf.ByteString
        getTfdbgContextIdBytes() {
      java.lang.Object ref = tfdbgContextId_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        tfdbgContextId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Unique ID of the context that the executed op(s) belong to (e.g., a
     * compiled concrete tf.function).
     * </pre>
     *
     * <code>string tfdbg_context_id = 1;</code>
     */
    public Builder setTfdbgContextId(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      tfdbgContextId_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Unique ID of the context that the executed op(s) belong to (e.g., a
     * compiled concrete tf.function).
     * </pre>
     *
     * <code>string tfdbg_context_id = 1;</code>
     */
    public Builder clearTfdbgContextId() {
      
      tfdbgContextId_ = getDefaultInstance().getTfdbgContextId();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Unique ID of the context that the executed op(s) belong to (e.g., a
     * compiled concrete tf.function).
     * </pre>
     *
     * <code>string tfdbg_context_id = 1;</code>
     */
    public Builder setTfdbgContextIdBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      tfdbgContextId_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object opName_ = "";
    /**
     * <pre>
     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
     * level).
     * </pre>
     *
     * <code>string op_name = 2;</code>
     */
    public java.lang.String getOpName() {
      java.lang.Object ref = opName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        opName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
     * level).
     * </pre>
     *
     * <code>string op_name = 2;</code>
     */
    public com.google.protobuf.ByteString
        getOpNameBytes() {
      java.lang.Object ref = opName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        opName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
     * level).
     * </pre>
     *
     * <code>string op_name = 2;</code>
     */
    public Builder setOpName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      opName_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
     * level).
     * </pre>
     *
     * <code>string op_name = 2;</code>
     */
    public Builder clearOpName() {
      
      opName_ = getDefaultInstance().getOpName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Name of the op (applicable only in the case of the `FULL_TENSOR` trace
     * level).
     * </pre>
     *
     * <code>string op_name = 2;</code>
     */
    public Builder setOpNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      opName_ = value;
      onChanged();
      return this;
    }

    private int outputSlot_ ;
    /**
     * <pre>
     * Output slot of the tensor (applicable only in the case of the `FULL_TENSOR`
     * trace level).
     * </pre>
     *
     * <code>int32 output_slot = 3;</code>
     */
    public int getOutputSlot() {
      return outputSlot_;
    }
    /**
     * <pre>
     * Output slot of the tensor (applicable only in the case of the `FULL_TENSOR`
     * trace level).
     * </pre>
     *
     * <code>int32 output_slot = 3;</code>
     */
    public Builder setOutputSlot(int value) {
      
      outputSlot_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Output slot of the tensor (applicable only in the case of the `FULL_TENSOR`
     * trace level).
     * </pre>
     *
     * <code>int32 output_slot = 3;</code>
     */
    public Builder clearOutputSlot() {
      
      outputSlot_ = 0;
      onChanged();
      return this;
    }

    private int tensorDebugMode_ = 0;
    /**
     * <pre>
     * Type of the tensor value encapsulated in this proto.
     * </pre>
     *
     * <code>.tensorflow.TensorDebugMode tensor_debug_mode = 4;</code>
     */
    public int getTensorDebugModeValue() {
      return tensorDebugMode_;
    }
    /**
     * <pre>
     * Type of the tensor value encapsulated in this proto.
     * </pre>
     *
     * <code>.tensorflow.TensorDebugMode tensor_debug_mode = 4;</code>
     */
    public Builder setTensorDebugModeValue(int value) {
      tensorDebugMode_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Type of the tensor value encapsulated in this proto.
     * </pre>
     *
     * <code>.tensorflow.TensorDebugMode tensor_debug_mode = 4;</code>
     */
    public org.tensorflow.proto.util.TensorDebugMode getTensorDebugMode() {
      @SuppressWarnings("deprecation")
      org.tensorflow.proto.util.TensorDebugMode result = org.tensorflow.proto.util.TensorDebugMode.valueOf(tensorDebugMode_);
      return result == null ? org.tensorflow.proto.util.TensorDebugMode.UNRECOGNIZED : result;
    }
    /**
     * <pre>
     * Type of the tensor value encapsulated in this proto.
     * </pre>
     *
     * <code>.tensorflow.TensorDebugMode tensor_debug_mode = 4;</code>
     */
    public Builder setTensorDebugMode(org.tensorflow.proto.util.TensorDebugMode value) {
      if (value == null) {
        throw new NullPointerException();
      }
      
      tensorDebugMode_ = value.getNumber();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Type of the tensor value encapsulated in this proto.
     * </pre>
     *
     * <code>.tensorflow.TensorDebugMode tensor_debug_mode = 4;</code>
     */
    public Builder clearTensorDebugMode() {
      
      tensorDebugMode_ = 0;
      onChanged();
      return this;
    }

    private org.tensorflow.proto.framework.TensorProto tensorProto_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> tensorProtoBuilder_;
    /**
     * <pre>
     * Tensor value in the type described by `tensor_value_type`.
     * This tensor may summarize the value of a single intermediate op of the
     * graph, or those of multiple intermediate tensors.
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor_proto = 5;</code>
     */
    public boolean hasTensorProto() {
      return tensorProtoBuilder_ != null || tensorProto_ != null;
    }
    /**
     * <pre>
     * Tensor value in the type described by `tensor_value_type`.
     * This tensor may summarize the value of a single intermediate op of the
     * graph, or those of multiple intermediate tensors.
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor_proto = 5;</code>
     */
    public org.tensorflow.proto.framework.TensorProto getTensorProto() {
      if (tensorProtoBuilder_ == null) {
        return tensorProto_ == null ? org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : tensorProto_;
      } else {
        return tensorProtoBuilder_.getMessage();
      }
    }
    /**
     * <pre>
     * Tensor value in the type described by `tensor_value_type`.
     * This tensor may summarize the value of a single intermediate op of the
     * graph, or those of multiple intermediate tensors.
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor_proto = 5;</code>
     */
    public Builder setTensorProto(org.tensorflow.proto.framework.TensorProto value) {
      if (tensorProtoBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        tensorProto_ = value;
        onChanged();
      } else {
        tensorProtoBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <pre>
     * Tensor value in the type described by `tensor_value_type`.
     * This tensor may summarize the value of a single intermediate op of the
     * graph, or those of multiple intermediate tensors.
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor_proto = 5;</code>
     */
    public Builder setTensorProto(
        org.tensorflow.proto.framework.TensorProto.Builder builderForValue) {
      if (tensorProtoBuilder_ == null) {
        tensorProto_ = builderForValue.build();
        onChanged();
      } else {
        tensorProtoBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <pre>
     * Tensor value in the type described by `tensor_value_type`.
     * This tensor may summarize the value of a single intermediate op of the
     * graph, or those of multiple intermediate tensors.
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor_proto = 5;</code>
     */
    public Builder mergeTensorProto(org.tensorflow.proto.framework.TensorProto value) {
      if (tensorProtoBuilder_ == null) {
        if (tensorProto_ != null) {
          tensorProto_ =
            org.tensorflow.proto.framework.TensorProto.newBuilder(tensorProto_).mergeFrom(value).buildPartial();
        } else {
          tensorProto_ = value;
        }
        onChanged();
      } else {
        tensorProtoBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <pre>
     * Tensor value in the type described by `tensor_value_type`.
     * This tensor may summarize the value of a single intermediate op of the
     * graph, or those of multiple intermediate tensors.
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor_proto = 5;</code>
     */
    public Builder clearTensorProto() {
      if (tensorProtoBuilder_ == null) {
        tensorProto_ = null;
        onChanged();
      } else {
        tensorProto_ = null;
        tensorProtoBuilder_ = null;
      }

      return this;
    }
    /**
     * <pre>
     * Tensor value in the type described by `tensor_value_type`.
     * This tensor may summarize the value of a single intermediate op of the
     * graph, or those of multiple intermediate tensors.
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor_proto = 5;</code>
     */
    public org.tensorflow.proto.framework.TensorProto.Builder getTensorProtoBuilder() {
      
      onChanged();
      return getTensorProtoFieldBuilder().getBuilder();
    }
    /**
     * <pre>
     * Tensor value in the type described by `tensor_value_type`.
     * This tensor may summarize the value of a single intermediate op of the
     * graph, or those of multiple intermediate tensors.
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor_proto = 5;</code>
     */
    public org.tensorflow.proto.framework.TensorProtoOrBuilder getTensorProtoOrBuilder() {
      if (tensorProtoBuilder_ != null) {
        return tensorProtoBuilder_.getMessageOrBuilder();
      } else {
        return tensorProto_ == null ?
            org.tensorflow.proto.framework.TensorProto.getDefaultInstance() : tensorProto_;
      }
    }
    /**
     * <pre>
     * Tensor value in the type described by `tensor_value_type`.
     * This tensor may summarize the value of a single intermediate op of the
     * graph, or those of multiple intermediate tensors.
     * </pre>
     *
     * <code>.tensorflow.TensorProto tensor_proto = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder> 
        getTensorProtoFieldBuilder() {
      if (tensorProtoBuilder_ == null) {
        tensorProtoBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tensorflow.proto.framework.TensorProto, org.tensorflow.proto.framework.TensorProto.Builder, org.tensorflow.proto.framework.TensorProtoOrBuilder>(
                getTensorProto(),
                getParentForChildren(),
                isClean());
        tensorProto_ = null;
      }
      return tensorProtoBuilder_;
    }

    private java.lang.Object deviceName_ = "";
    /**
     * <pre>
     * Name of the device that the op belongs to.
     * </pre>
     *
     * <code>string device_name = 6;</code>
     */
    public java.lang.String getDeviceName() {
      java.lang.Object ref = deviceName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        deviceName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Name of the device that the op belongs to.
     * </pre>
     *
     * <code>string device_name = 6;</code>
     */
    public com.google.protobuf.ByteString
        getDeviceNameBytes() {
      java.lang.Object ref = deviceName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        deviceName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Name of the device that the op belongs to.
     * </pre>
     *
     * <code>string device_name = 6;</code>
     */
    public Builder setDeviceName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      deviceName_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Name of the device that the op belongs to.
     * </pre>
     *
     * <code>string device_name = 6;</code>
     */
    public Builder clearDeviceName() {
      
      deviceName_ = getDefaultInstance().getDeviceName();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Name of the device that the op belongs to.
     * </pre>
     *
     * <code>string device_name = 6;</code>
     */
    public Builder setDeviceNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      deviceName_ = value;
      onChanged();
      return this;
    }
    @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.GraphExecutionTrace)
  }

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

  public static org.tensorflow.proto.util.GraphExecutionTrace getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

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

}

