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

package org.tensorflow.proto.util;

/**
 * Protobuf type {@code tensorflow.MemoryDump}
 */
public  final class MemoryDump extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.MemoryDump)
    MemoryDumpOrBuilder {
private static final long serialVersionUID = 0L;
  // Use MemoryDump.newBuilder() to construct.
  private MemoryDump(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private MemoryDump() {
    allocatorName_ = "";
    binSummary_ = java.util.Collections.emptyList();
    chunk_ = java.util.Collections.emptyList();
    snapShot_ = java.util.Collections.emptyList();
  }

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private MemoryDump(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    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();

            allocatorName_ = s;
            break;
          }
          case 18: {
            if (!((mutable_bitField0_ & 0x00000001) != 0)) {
              binSummary_ = new java.util.ArrayList<org.tensorflow.proto.util.BinSummary>();
              mutable_bitField0_ |= 0x00000001;
            }
            binSummary_.add(
                input.readMessage(org.tensorflow.proto.util.BinSummary.parser(), extensionRegistry));
            break;
          }
          case 26: {
            if (!((mutable_bitField0_ & 0x00000002) != 0)) {
              chunk_ = new java.util.ArrayList<org.tensorflow.proto.util.MemChunk>();
              mutable_bitField0_ |= 0x00000002;
            }
            chunk_.add(
                input.readMessage(org.tensorflow.proto.util.MemChunk.parser(), extensionRegistry));
            break;
          }
          case 34: {
            if (!((mutable_bitField0_ & 0x00000004) != 0)) {
              snapShot_ = new java.util.ArrayList<org.tensorflow.proto.util.SnapShot>();
              mutable_bitField0_ |= 0x00000004;
            }
            snapShot_.add(
                input.readMessage(org.tensorflow.proto.util.SnapShot.parser(), extensionRegistry));
            break;
          }
          case 42: {
            org.tensorflow.proto.util.MemAllocatorStats.Builder subBuilder = null;
            if (stats_ != null) {
              subBuilder = stats_.toBuilder();
            }
            stats_ = input.readMessage(org.tensorflow.proto.util.MemAllocatorStats.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(stats_);
              stats_ = 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 {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        binSummary_ = java.util.Collections.unmodifiableList(binSummary_);
      }
      if (((mutable_bitField0_ & 0x00000002) != 0)) {
        chunk_ = java.util.Collections.unmodifiableList(chunk_);
      }
      if (((mutable_bitField0_ & 0x00000004) != 0)) {
        snapShot_ = java.util.Collections.unmodifiableList(snapShot_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemoryDump_descriptor;
  }

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

  public static final int ALLOCATOR_NAME_FIELD_NUMBER = 1;
  private volatile java.lang.Object allocatorName_;
  /**
   * <code>string allocator_name = 1;</code>
   */
  public java.lang.String getAllocatorName() {
    java.lang.Object ref = allocatorName_;
    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();
      allocatorName_ = s;
      return s;
    }
  }
  /**
   * <code>string allocator_name = 1;</code>
   */
  public com.google.protobuf.ByteString
      getAllocatorNameBytes() {
    java.lang.Object ref = allocatorName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      allocatorName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int BIN_SUMMARY_FIELD_NUMBER = 2;
  private java.util.List<org.tensorflow.proto.util.BinSummary> binSummary_;
  /**
   * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
   */
  public java.util.List<org.tensorflow.proto.util.BinSummary> getBinSummaryList() {
    return binSummary_;
  }
  /**
   * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
   */
  public java.util.List<? extends org.tensorflow.proto.util.BinSummaryOrBuilder> 
      getBinSummaryOrBuilderList() {
    return binSummary_;
  }
  /**
   * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
   */
  public int getBinSummaryCount() {
    return binSummary_.size();
  }
  /**
   * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
   */
  public org.tensorflow.proto.util.BinSummary getBinSummary(int index) {
    return binSummary_.get(index);
  }
  /**
   * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
   */
  public org.tensorflow.proto.util.BinSummaryOrBuilder getBinSummaryOrBuilder(
      int index) {
    return binSummary_.get(index);
  }

  public static final int CHUNK_FIELD_NUMBER = 3;
  private java.util.List<org.tensorflow.proto.util.MemChunk> chunk_;
  /**
   * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
   */
  public java.util.List<org.tensorflow.proto.util.MemChunk> getChunkList() {
    return chunk_;
  }
  /**
   * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
   */
  public java.util.List<? extends org.tensorflow.proto.util.MemChunkOrBuilder> 
      getChunkOrBuilderList() {
    return chunk_;
  }
  /**
   * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
   */
  public int getChunkCount() {
    return chunk_.size();
  }
  /**
   * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
   */
  public org.tensorflow.proto.util.MemChunk getChunk(int index) {
    return chunk_.get(index);
  }
  /**
   * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
   */
  public org.tensorflow.proto.util.MemChunkOrBuilder getChunkOrBuilder(
      int index) {
    return chunk_.get(index);
  }

  public static final int SNAP_SHOT_FIELD_NUMBER = 4;
  private java.util.List<org.tensorflow.proto.util.SnapShot> snapShot_;
  /**
   * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
   */
  public java.util.List<org.tensorflow.proto.util.SnapShot> getSnapShotList() {
    return snapShot_;
  }
  /**
   * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
   */
  public java.util.List<? extends org.tensorflow.proto.util.SnapShotOrBuilder> 
      getSnapShotOrBuilderList() {
    return snapShot_;
  }
  /**
   * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
   */
  public int getSnapShotCount() {
    return snapShot_.size();
  }
  /**
   * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
   */
  public org.tensorflow.proto.util.SnapShot getSnapShot(int index) {
    return snapShot_.get(index);
  }
  /**
   * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
   */
  public org.tensorflow.proto.util.SnapShotOrBuilder getSnapShotOrBuilder(
      int index) {
    return snapShot_.get(index);
  }

  public static final int STATS_FIELD_NUMBER = 5;
  private org.tensorflow.proto.util.MemAllocatorStats stats_;
  /**
   * <code>.tensorflow.MemAllocatorStats stats = 5;</code>
   */
  public boolean hasStats() {
    return stats_ != null;
  }
  /**
   * <code>.tensorflow.MemAllocatorStats stats = 5;</code>
   */
  public org.tensorflow.proto.util.MemAllocatorStats getStats() {
    return stats_ == null ? org.tensorflow.proto.util.MemAllocatorStats.getDefaultInstance() : stats_;
  }
  /**
   * <code>.tensorflow.MemAllocatorStats stats = 5;</code>
   */
  public org.tensorflow.proto.util.MemAllocatorStatsOrBuilder getStatsOrBuilder() {
    return getStats();
  }

  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 (!getAllocatorNameBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allocatorName_);
    }
    for (int i = 0; i < binSummary_.size(); i++) {
      output.writeMessage(2, binSummary_.get(i));
    }
    for (int i = 0; i < chunk_.size(); i++) {
      output.writeMessage(3, chunk_.get(i));
    }
    for (int i = 0; i < snapShot_.size(); i++) {
      output.writeMessage(4, snapShot_.get(i));
    }
    if (stats_ != null) {
      output.writeMessage(5, getStats());
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getAllocatorNameBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, allocatorName_);
    }
    for (int i = 0; i < binSummary_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, binSummary_.get(i));
    }
    for (int i = 0; i < chunk_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, chunk_.get(i));
    }
    for (int i = 0; i < snapShot_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, snapShot_.get(i));
    }
    if (stats_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(5, getStats());
    }
    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.MemoryDump)) {
      return super.equals(obj);
    }
    org.tensorflow.proto.util.MemoryDump other = (org.tensorflow.proto.util.MemoryDump) obj;

    if (!getAllocatorName()
        .equals(other.getAllocatorName())) return false;
    if (!getBinSummaryList()
        .equals(other.getBinSummaryList())) return false;
    if (!getChunkList()
        .equals(other.getChunkList())) return false;
    if (!getSnapShotList()
        .equals(other.getSnapShotList())) return false;
    if (hasStats() != other.hasStats()) return false;
    if (hasStats()) {
      if (!getStats()
          .equals(other.getStats())) 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) + ALLOCATOR_NAME_FIELD_NUMBER;
    hash = (53 * hash) + getAllocatorName().hashCode();
    if (getBinSummaryCount() > 0) {
      hash = (37 * hash) + BIN_SUMMARY_FIELD_NUMBER;
      hash = (53 * hash) + getBinSummaryList().hashCode();
    }
    if (getChunkCount() > 0) {
      hash = (37 * hash) + CHUNK_FIELD_NUMBER;
      hash = (53 * hash) + getChunkList().hashCode();
    }
    if (getSnapShotCount() > 0) {
      hash = (37 * hash) + SNAP_SHOT_FIELD_NUMBER;
      hash = (53 * hash) + getSnapShotList().hashCode();
    }
    if (hasStats()) {
      hash = (37 * hash) + STATS_FIELD_NUMBER;
      hash = (53 * hash) + getStats().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static org.tensorflow.proto.util.MemoryDump parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.util.MemoryDump 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.MemoryDump parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.util.MemoryDump 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.MemoryDump parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.tensorflow.proto.util.MemoryDump parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.tensorflow.proto.util.MemoryDump parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.util.MemoryDump 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.MemoryDump parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.util.MemoryDump 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.MemoryDump parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static org.tensorflow.proto.util.MemoryDump 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.MemoryDump 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.MemoryDump}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.MemoryDump)
      org.tensorflow.proto.util.MemoryDumpOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.util.BfcMemoryMapProtos.internal_static_tensorflow_MemoryDump_descriptor;
    }

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

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

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getBinSummaryFieldBuilder();
        getChunkFieldBuilder();
        getSnapShotFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      allocatorName_ = "";

      if (binSummaryBuilder_ == null) {
        binSummary_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        binSummaryBuilder_.clear();
      }
      if (chunkBuilder_ == null) {
        chunk_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
      } else {
        chunkBuilder_.clear();
      }
      if (snapShotBuilder_ == null) {
        snapShot_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
      } else {
        snapShotBuilder_.clear();
      }
      if (statsBuilder_ == null) {
        stats_ = null;
      } else {
        stats_ = null;
        statsBuilder_ = null;
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public org.tensorflow.proto.util.MemoryDump buildPartial() {
      org.tensorflow.proto.util.MemoryDump result = new org.tensorflow.proto.util.MemoryDump(this);
      int from_bitField0_ = bitField0_;
      result.allocatorName_ = allocatorName_;
      if (binSummaryBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          binSummary_ = java.util.Collections.unmodifiableList(binSummary_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.binSummary_ = binSummary_;
      } else {
        result.binSummary_ = binSummaryBuilder_.build();
      }
      if (chunkBuilder_ == null) {
        if (((bitField0_ & 0x00000002) != 0)) {
          chunk_ = java.util.Collections.unmodifiableList(chunk_);
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.chunk_ = chunk_;
      } else {
        result.chunk_ = chunkBuilder_.build();
      }
      if (snapShotBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)) {
          snapShot_ = java.util.Collections.unmodifiableList(snapShot_);
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.snapShot_ = snapShot_;
      } else {
        result.snapShot_ = snapShotBuilder_.build();
      }
      if (statsBuilder_ == null) {
        result.stats_ = stats_;
      } else {
        result.stats_ = statsBuilder_.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.util.MemoryDump) {
        return mergeFrom((org.tensorflow.proto.util.MemoryDump)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.proto.util.MemoryDump other) {
      if (other == org.tensorflow.proto.util.MemoryDump.getDefaultInstance()) return this;
      if (!other.getAllocatorName().isEmpty()) {
        allocatorName_ = other.allocatorName_;
        onChanged();
      }
      if (binSummaryBuilder_ == null) {
        if (!other.binSummary_.isEmpty()) {
          if (binSummary_.isEmpty()) {
            binSummary_ = other.binSummary_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureBinSummaryIsMutable();
            binSummary_.addAll(other.binSummary_);
          }
          onChanged();
        }
      } else {
        if (!other.binSummary_.isEmpty()) {
          if (binSummaryBuilder_.isEmpty()) {
            binSummaryBuilder_.dispose();
            binSummaryBuilder_ = null;
            binSummary_ = other.binSummary_;
            bitField0_ = (bitField0_ & ~0x00000001);
            binSummaryBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getBinSummaryFieldBuilder() : null;
          } else {
            binSummaryBuilder_.addAllMessages(other.binSummary_);
          }
        }
      }
      if (chunkBuilder_ == null) {
        if (!other.chunk_.isEmpty()) {
          if (chunk_.isEmpty()) {
            chunk_ = other.chunk_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureChunkIsMutable();
            chunk_.addAll(other.chunk_);
          }
          onChanged();
        }
      } else {
        if (!other.chunk_.isEmpty()) {
          if (chunkBuilder_.isEmpty()) {
            chunkBuilder_.dispose();
            chunkBuilder_ = null;
            chunk_ = other.chunk_;
            bitField0_ = (bitField0_ & ~0x00000002);
            chunkBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getChunkFieldBuilder() : null;
          } else {
            chunkBuilder_.addAllMessages(other.chunk_);
          }
        }
      }
      if (snapShotBuilder_ == null) {
        if (!other.snapShot_.isEmpty()) {
          if (snapShot_.isEmpty()) {
            snapShot_ = other.snapShot_;
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            ensureSnapShotIsMutable();
            snapShot_.addAll(other.snapShot_);
          }
          onChanged();
        }
      } else {
        if (!other.snapShot_.isEmpty()) {
          if (snapShotBuilder_.isEmpty()) {
            snapShotBuilder_.dispose();
            snapShotBuilder_ = null;
            snapShot_ = other.snapShot_;
            bitField0_ = (bitField0_ & ~0x00000004);
            snapShotBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getSnapShotFieldBuilder() : null;
          } else {
            snapShotBuilder_.addAllMessages(other.snapShot_);
          }
        }
      }
      if (other.hasStats()) {
        mergeStats(other.getStats());
      }
      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.MemoryDump parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.proto.util.MemoryDump) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.lang.Object allocatorName_ = "";
    /**
     * <code>string allocator_name = 1;</code>
     */
    public java.lang.String getAllocatorName() {
      java.lang.Object ref = allocatorName_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        allocatorName_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>string allocator_name = 1;</code>
     */
    public com.google.protobuf.ByteString
        getAllocatorNameBytes() {
      java.lang.Object ref = allocatorName_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        allocatorName_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>string allocator_name = 1;</code>
     */
    public Builder setAllocatorName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      allocatorName_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>string allocator_name = 1;</code>
     */
    public Builder clearAllocatorName() {
      
      allocatorName_ = getDefaultInstance().getAllocatorName();
      onChanged();
      return this;
    }
    /**
     * <code>string allocator_name = 1;</code>
     */
    public Builder setAllocatorNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      allocatorName_ = value;
      onChanged();
      return this;
    }

    private java.util.List<org.tensorflow.proto.util.BinSummary> binSummary_ =
      java.util.Collections.emptyList();
    private void ensureBinSummaryIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        binSummary_ = new java.util.ArrayList<org.tensorflow.proto.util.BinSummary>(binSummary_);
        bitField0_ |= 0x00000001;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.util.BinSummary, org.tensorflow.proto.util.BinSummary.Builder, org.tensorflow.proto.util.BinSummaryOrBuilder> binSummaryBuilder_;

    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public java.util.List<org.tensorflow.proto.util.BinSummary> getBinSummaryList() {
      if (binSummaryBuilder_ == null) {
        return java.util.Collections.unmodifiableList(binSummary_);
      } else {
        return binSummaryBuilder_.getMessageList();
      }
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public int getBinSummaryCount() {
      if (binSummaryBuilder_ == null) {
        return binSummary_.size();
      } else {
        return binSummaryBuilder_.getCount();
      }
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public org.tensorflow.proto.util.BinSummary getBinSummary(int index) {
      if (binSummaryBuilder_ == null) {
        return binSummary_.get(index);
      } else {
        return binSummaryBuilder_.getMessage(index);
      }
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public Builder setBinSummary(
        int index, org.tensorflow.proto.util.BinSummary value) {
      if (binSummaryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureBinSummaryIsMutable();
        binSummary_.set(index, value);
        onChanged();
      } else {
        binSummaryBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public Builder setBinSummary(
        int index, org.tensorflow.proto.util.BinSummary.Builder builderForValue) {
      if (binSummaryBuilder_ == null) {
        ensureBinSummaryIsMutable();
        binSummary_.set(index, builderForValue.build());
        onChanged();
      } else {
        binSummaryBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public Builder addBinSummary(org.tensorflow.proto.util.BinSummary value) {
      if (binSummaryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureBinSummaryIsMutable();
        binSummary_.add(value);
        onChanged();
      } else {
        binSummaryBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public Builder addBinSummary(
        int index, org.tensorflow.proto.util.BinSummary value) {
      if (binSummaryBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureBinSummaryIsMutable();
        binSummary_.add(index, value);
        onChanged();
      } else {
        binSummaryBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public Builder addBinSummary(
        org.tensorflow.proto.util.BinSummary.Builder builderForValue) {
      if (binSummaryBuilder_ == null) {
        ensureBinSummaryIsMutable();
        binSummary_.add(builderForValue.build());
        onChanged();
      } else {
        binSummaryBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public Builder addBinSummary(
        int index, org.tensorflow.proto.util.BinSummary.Builder builderForValue) {
      if (binSummaryBuilder_ == null) {
        ensureBinSummaryIsMutable();
        binSummary_.add(index, builderForValue.build());
        onChanged();
      } else {
        binSummaryBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public Builder addAllBinSummary(
        java.lang.Iterable<? extends org.tensorflow.proto.util.BinSummary> values) {
      if (binSummaryBuilder_ == null) {
        ensureBinSummaryIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, binSummary_);
        onChanged();
      } else {
        binSummaryBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public Builder clearBinSummary() {
      if (binSummaryBuilder_ == null) {
        binSummary_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        binSummaryBuilder_.clear();
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public Builder removeBinSummary(int index) {
      if (binSummaryBuilder_ == null) {
        ensureBinSummaryIsMutable();
        binSummary_.remove(index);
        onChanged();
      } else {
        binSummaryBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public org.tensorflow.proto.util.BinSummary.Builder getBinSummaryBuilder(
        int index) {
      return getBinSummaryFieldBuilder().getBuilder(index);
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public org.tensorflow.proto.util.BinSummaryOrBuilder getBinSummaryOrBuilder(
        int index) {
      if (binSummaryBuilder_ == null) {
        return binSummary_.get(index);  } else {
        return binSummaryBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public java.util.List<? extends org.tensorflow.proto.util.BinSummaryOrBuilder> 
         getBinSummaryOrBuilderList() {
      if (binSummaryBuilder_ != null) {
        return binSummaryBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(binSummary_);
      }
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public org.tensorflow.proto.util.BinSummary.Builder addBinSummaryBuilder() {
      return getBinSummaryFieldBuilder().addBuilder(
          org.tensorflow.proto.util.BinSummary.getDefaultInstance());
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public org.tensorflow.proto.util.BinSummary.Builder addBinSummaryBuilder(
        int index) {
      return getBinSummaryFieldBuilder().addBuilder(
          index, org.tensorflow.proto.util.BinSummary.getDefaultInstance());
    }
    /**
     * <code>repeated .tensorflow.BinSummary bin_summary = 2;</code>
     */
    public java.util.List<org.tensorflow.proto.util.BinSummary.Builder> 
         getBinSummaryBuilderList() {
      return getBinSummaryFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.util.BinSummary, org.tensorflow.proto.util.BinSummary.Builder, org.tensorflow.proto.util.BinSummaryOrBuilder> 
        getBinSummaryFieldBuilder() {
      if (binSummaryBuilder_ == null) {
        binSummaryBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            org.tensorflow.proto.util.BinSummary, org.tensorflow.proto.util.BinSummary.Builder, org.tensorflow.proto.util.BinSummaryOrBuilder>(
                binSummary_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        binSummary_ = null;
      }
      return binSummaryBuilder_;
    }

    private java.util.List<org.tensorflow.proto.util.MemChunk> chunk_ =
      java.util.Collections.emptyList();
    private void ensureChunkIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        chunk_ = new java.util.ArrayList<org.tensorflow.proto.util.MemChunk>(chunk_);
        bitField0_ |= 0x00000002;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.util.MemChunk, org.tensorflow.proto.util.MemChunk.Builder, org.tensorflow.proto.util.MemChunkOrBuilder> chunkBuilder_;

    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public java.util.List<org.tensorflow.proto.util.MemChunk> getChunkList() {
      if (chunkBuilder_ == null) {
        return java.util.Collections.unmodifiableList(chunk_);
      } else {
        return chunkBuilder_.getMessageList();
      }
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public int getChunkCount() {
      if (chunkBuilder_ == null) {
        return chunk_.size();
      } else {
        return chunkBuilder_.getCount();
      }
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public org.tensorflow.proto.util.MemChunk getChunk(int index) {
      if (chunkBuilder_ == null) {
        return chunk_.get(index);
      } else {
        return chunkBuilder_.getMessage(index);
      }
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public Builder setChunk(
        int index, org.tensorflow.proto.util.MemChunk value) {
      if (chunkBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureChunkIsMutable();
        chunk_.set(index, value);
        onChanged();
      } else {
        chunkBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public Builder setChunk(
        int index, org.tensorflow.proto.util.MemChunk.Builder builderForValue) {
      if (chunkBuilder_ == null) {
        ensureChunkIsMutable();
        chunk_.set(index, builderForValue.build());
        onChanged();
      } else {
        chunkBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public Builder addChunk(org.tensorflow.proto.util.MemChunk value) {
      if (chunkBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureChunkIsMutable();
        chunk_.add(value);
        onChanged();
      } else {
        chunkBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public Builder addChunk(
        int index, org.tensorflow.proto.util.MemChunk value) {
      if (chunkBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureChunkIsMutable();
        chunk_.add(index, value);
        onChanged();
      } else {
        chunkBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public Builder addChunk(
        org.tensorflow.proto.util.MemChunk.Builder builderForValue) {
      if (chunkBuilder_ == null) {
        ensureChunkIsMutable();
        chunk_.add(builderForValue.build());
        onChanged();
      } else {
        chunkBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public Builder addChunk(
        int index, org.tensorflow.proto.util.MemChunk.Builder builderForValue) {
      if (chunkBuilder_ == null) {
        ensureChunkIsMutable();
        chunk_.add(index, builderForValue.build());
        onChanged();
      } else {
        chunkBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public Builder addAllChunk(
        java.lang.Iterable<? extends org.tensorflow.proto.util.MemChunk> values) {
      if (chunkBuilder_ == null) {
        ensureChunkIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, chunk_);
        onChanged();
      } else {
        chunkBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public Builder clearChunk() {
      if (chunkBuilder_ == null) {
        chunk_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
      } else {
        chunkBuilder_.clear();
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public Builder removeChunk(int index) {
      if (chunkBuilder_ == null) {
        ensureChunkIsMutable();
        chunk_.remove(index);
        onChanged();
      } else {
        chunkBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public org.tensorflow.proto.util.MemChunk.Builder getChunkBuilder(
        int index) {
      return getChunkFieldBuilder().getBuilder(index);
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public org.tensorflow.proto.util.MemChunkOrBuilder getChunkOrBuilder(
        int index) {
      if (chunkBuilder_ == null) {
        return chunk_.get(index);  } else {
        return chunkBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public java.util.List<? extends org.tensorflow.proto.util.MemChunkOrBuilder> 
         getChunkOrBuilderList() {
      if (chunkBuilder_ != null) {
        return chunkBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(chunk_);
      }
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public org.tensorflow.proto.util.MemChunk.Builder addChunkBuilder() {
      return getChunkFieldBuilder().addBuilder(
          org.tensorflow.proto.util.MemChunk.getDefaultInstance());
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public org.tensorflow.proto.util.MemChunk.Builder addChunkBuilder(
        int index) {
      return getChunkFieldBuilder().addBuilder(
          index, org.tensorflow.proto.util.MemChunk.getDefaultInstance());
    }
    /**
     * <code>repeated .tensorflow.MemChunk chunk = 3;</code>
     */
    public java.util.List<org.tensorflow.proto.util.MemChunk.Builder> 
         getChunkBuilderList() {
      return getChunkFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.util.MemChunk, org.tensorflow.proto.util.MemChunk.Builder, org.tensorflow.proto.util.MemChunkOrBuilder> 
        getChunkFieldBuilder() {
      if (chunkBuilder_ == null) {
        chunkBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            org.tensorflow.proto.util.MemChunk, org.tensorflow.proto.util.MemChunk.Builder, org.tensorflow.proto.util.MemChunkOrBuilder>(
                chunk_,
                ((bitField0_ & 0x00000002) != 0),
                getParentForChildren(),
                isClean());
        chunk_ = null;
      }
      return chunkBuilder_;
    }

    private java.util.List<org.tensorflow.proto.util.SnapShot> snapShot_ =
      java.util.Collections.emptyList();
    private void ensureSnapShotIsMutable() {
      if (!((bitField0_ & 0x00000004) != 0)) {
        snapShot_ = new java.util.ArrayList<org.tensorflow.proto.util.SnapShot>(snapShot_);
        bitField0_ |= 0x00000004;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.util.SnapShot, org.tensorflow.proto.util.SnapShot.Builder, org.tensorflow.proto.util.SnapShotOrBuilder> snapShotBuilder_;

    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public java.util.List<org.tensorflow.proto.util.SnapShot> getSnapShotList() {
      if (snapShotBuilder_ == null) {
        return java.util.Collections.unmodifiableList(snapShot_);
      } else {
        return snapShotBuilder_.getMessageList();
      }
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public int getSnapShotCount() {
      if (snapShotBuilder_ == null) {
        return snapShot_.size();
      } else {
        return snapShotBuilder_.getCount();
      }
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public org.tensorflow.proto.util.SnapShot getSnapShot(int index) {
      if (snapShotBuilder_ == null) {
        return snapShot_.get(index);
      } else {
        return snapShotBuilder_.getMessage(index);
      }
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public Builder setSnapShot(
        int index, org.tensorflow.proto.util.SnapShot value) {
      if (snapShotBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSnapShotIsMutable();
        snapShot_.set(index, value);
        onChanged();
      } else {
        snapShotBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public Builder setSnapShot(
        int index, org.tensorflow.proto.util.SnapShot.Builder builderForValue) {
      if (snapShotBuilder_ == null) {
        ensureSnapShotIsMutable();
        snapShot_.set(index, builderForValue.build());
        onChanged();
      } else {
        snapShotBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public Builder addSnapShot(org.tensorflow.proto.util.SnapShot value) {
      if (snapShotBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSnapShotIsMutable();
        snapShot_.add(value);
        onChanged();
      } else {
        snapShotBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public Builder addSnapShot(
        int index, org.tensorflow.proto.util.SnapShot value) {
      if (snapShotBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureSnapShotIsMutable();
        snapShot_.add(index, value);
        onChanged();
      } else {
        snapShotBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public Builder addSnapShot(
        org.tensorflow.proto.util.SnapShot.Builder builderForValue) {
      if (snapShotBuilder_ == null) {
        ensureSnapShotIsMutable();
        snapShot_.add(builderForValue.build());
        onChanged();
      } else {
        snapShotBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public Builder addSnapShot(
        int index, org.tensorflow.proto.util.SnapShot.Builder builderForValue) {
      if (snapShotBuilder_ == null) {
        ensureSnapShotIsMutable();
        snapShot_.add(index, builderForValue.build());
        onChanged();
      } else {
        snapShotBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public Builder addAllSnapShot(
        java.lang.Iterable<? extends org.tensorflow.proto.util.SnapShot> values) {
      if (snapShotBuilder_ == null) {
        ensureSnapShotIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, snapShot_);
        onChanged();
      } else {
        snapShotBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public Builder clearSnapShot() {
      if (snapShotBuilder_ == null) {
        snapShot_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
      } else {
        snapShotBuilder_.clear();
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public Builder removeSnapShot(int index) {
      if (snapShotBuilder_ == null) {
        ensureSnapShotIsMutable();
        snapShot_.remove(index);
        onChanged();
      } else {
        snapShotBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public org.tensorflow.proto.util.SnapShot.Builder getSnapShotBuilder(
        int index) {
      return getSnapShotFieldBuilder().getBuilder(index);
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public org.tensorflow.proto.util.SnapShotOrBuilder getSnapShotOrBuilder(
        int index) {
      if (snapShotBuilder_ == null) {
        return snapShot_.get(index);  } else {
        return snapShotBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public java.util.List<? extends org.tensorflow.proto.util.SnapShotOrBuilder> 
         getSnapShotOrBuilderList() {
      if (snapShotBuilder_ != null) {
        return snapShotBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(snapShot_);
      }
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public org.tensorflow.proto.util.SnapShot.Builder addSnapShotBuilder() {
      return getSnapShotFieldBuilder().addBuilder(
          org.tensorflow.proto.util.SnapShot.getDefaultInstance());
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public org.tensorflow.proto.util.SnapShot.Builder addSnapShotBuilder(
        int index) {
      return getSnapShotFieldBuilder().addBuilder(
          index, org.tensorflow.proto.util.SnapShot.getDefaultInstance());
    }
    /**
     * <code>repeated .tensorflow.SnapShot snap_shot = 4;</code>
     */
    public java.util.List<org.tensorflow.proto.util.SnapShot.Builder> 
         getSnapShotBuilderList() {
      return getSnapShotFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.util.SnapShot, org.tensorflow.proto.util.SnapShot.Builder, org.tensorflow.proto.util.SnapShotOrBuilder> 
        getSnapShotFieldBuilder() {
      if (snapShotBuilder_ == null) {
        snapShotBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            org.tensorflow.proto.util.SnapShot, org.tensorflow.proto.util.SnapShot.Builder, org.tensorflow.proto.util.SnapShotOrBuilder>(
                snapShot_,
                ((bitField0_ & 0x00000004) != 0),
                getParentForChildren(),
                isClean());
        snapShot_ = null;
      }
      return snapShotBuilder_;
    }

    private org.tensorflow.proto.util.MemAllocatorStats stats_;
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.util.MemAllocatorStats, org.tensorflow.proto.util.MemAllocatorStats.Builder, org.tensorflow.proto.util.MemAllocatorStatsOrBuilder> statsBuilder_;
    /**
     * <code>.tensorflow.MemAllocatorStats stats = 5;</code>
     */
    public boolean hasStats() {
      return statsBuilder_ != null || stats_ != null;
    }
    /**
     * <code>.tensorflow.MemAllocatorStats stats = 5;</code>
     */
    public org.tensorflow.proto.util.MemAllocatorStats getStats() {
      if (statsBuilder_ == null) {
        return stats_ == null ? org.tensorflow.proto.util.MemAllocatorStats.getDefaultInstance() : stats_;
      } else {
        return statsBuilder_.getMessage();
      }
    }
    /**
     * <code>.tensorflow.MemAllocatorStats stats = 5;</code>
     */
    public Builder setStats(org.tensorflow.proto.util.MemAllocatorStats value) {
      if (statsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        stats_ = value;
        onChanged();
      } else {
        statsBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * <code>.tensorflow.MemAllocatorStats stats = 5;</code>
     */
    public Builder setStats(
        org.tensorflow.proto.util.MemAllocatorStats.Builder builderForValue) {
      if (statsBuilder_ == null) {
        stats_ = builderForValue.build();
        onChanged();
      } else {
        statsBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * <code>.tensorflow.MemAllocatorStats stats = 5;</code>
     */
    public Builder mergeStats(org.tensorflow.proto.util.MemAllocatorStats value) {
      if (statsBuilder_ == null) {
        if (stats_ != null) {
          stats_ =
            org.tensorflow.proto.util.MemAllocatorStats.newBuilder(stats_).mergeFrom(value).buildPartial();
        } else {
          stats_ = value;
        }
        onChanged();
      } else {
        statsBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * <code>.tensorflow.MemAllocatorStats stats = 5;</code>
     */
    public Builder clearStats() {
      if (statsBuilder_ == null) {
        stats_ = null;
        onChanged();
      } else {
        stats_ = null;
        statsBuilder_ = null;
      }

      return this;
    }
    /**
     * <code>.tensorflow.MemAllocatorStats stats = 5;</code>
     */
    public org.tensorflow.proto.util.MemAllocatorStats.Builder getStatsBuilder() {
      
      onChanged();
      return getStatsFieldBuilder().getBuilder();
    }
    /**
     * <code>.tensorflow.MemAllocatorStats stats = 5;</code>
     */
    public org.tensorflow.proto.util.MemAllocatorStatsOrBuilder getStatsOrBuilder() {
      if (statsBuilder_ != null) {
        return statsBuilder_.getMessageOrBuilder();
      } else {
        return stats_ == null ?
            org.tensorflow.proto.util.MemAllocatorStats.getDefaultInstance() : stats_;
      }
    }
    /**
     * <code>.tensorflow.MemAllocatorStats stats = 5;</code>
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        org.tensorflow.proto.util.MemAllocatorStats, org.tensorflow.proto.util.MemAllocatorStats.Builder, org.tensorflow.proto.util.MemAllocatorStatsOrBuilder> 
        getStatsFieldBuilder() {
      if (statsBuilder_ == null) {
        statsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            org.tensorflow.proto.util.MemAllocatorStats, org.tensorflow.proto.util.MemAllocatorStats.Builder, org.tensorflow.proto.util.MemAllocatorStatsOrBuilder>(
                getStats(),
                getParentForChildren(),
                isClean());
        stats_ = null;
      }
      return statsBuilder_;
    }
    @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.MemoryDump)
  }

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

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

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

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

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

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

}

