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

package org.tensorflow.proto.framework;

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

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private AllocatorMemoryUsed(
      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 16: {

            totalBytes_ = input.readInt64();
            break;
          }
          case 24: {

            peakBytes_ = input.readInt64();
            break;
          }
          case 32: {

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

            allocatorBytesInUse_ = input.readInt64();
            break;
          }
          case 50: {
            if (!((mutable_bitField0_ & 0x00000001) != 0)) {
              allocationRecords_ = new java.util.ArrayList<org.tensorflow.proto.framework.AllocationRecord>();
              mutable_bitField0_ |= 0x00000001;
            }
            allocationRecords_.add(
                input.readMessage(org.tensorflow.proto.framework.AllocationRecord.parser(), extensionRegistry));
            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)) {
        allocationRecords_ = java.util.Collections.unmodifiableList(allocationRecords_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_AllocatorMemoryUsed_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_AllocatorMemoryUsed_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.proto.framework.AllocatorMemoryUsed.class, org.tensorflow.proto.framework.AllocatorMemoryUsed.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 TOTAL_BYTES_FIELD_NUMBER = 2;
  private long totalBytes_;
  /**
   * <pre>
   * These are per-node allocator memory stats.
   * </pre>
   *
   * <code>int64 total_bytes = 2;</code>
   */
  public long getTotalBytes() {
    return totalBytes_;
  }

  public static final int PEAK_BYTES_FIELD_NUMBER = 3;
  private long peakBytes_;
  /**
   * <code>int64 peak_bytes = 3;</code>
   */
  public long getPeakBytes() {
    return peakBytes_;
  }

  public static final int LIVE_BYTES_FIELD_NUMBER = 4;
  private long liveBytes_;
  /**
   * <pre>
   * The bytes that are not deallocated.
   * </pre>
   *
   * <code>int64 live_bytes = 4;</code>
   */
  public long getLiveBytes() {
    return liveBytes_;
  }

  public static final int ALLOCATION_RECORDS_FIELD_NUMBER = 6;
  private java.util.List<org.tensorflow.proto.framework.AllocationRecord> allocationRecords_;
  /**
   * <pre>
   * The allocation and deallocation timeline.
   * </pre>
   *
   * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
   */
  public java.util.List<org.tensorflow.proto.framework.AllocationRecord> getAllocationRecordsList() {
    return allocationRecords_;
  }
  /**
   * <pre>
   * The allocation and deallocation timeline.
   * </pre>
   *
   * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
   */
  public java.util.List<? extends org.tensorflow.proto.framework.AllocationRecordOrBuilder> 
      getAllocationRecordsOrBuilderList() {
    return allocationRecords_;
  }
  /**
   * <pre>
   * The allocation and deallocation timeline.
   * </pre>
   *
   * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
   */
  public int getAllocationRecordsCount() {
    return allocationRecords_.size();
  }
  /**
   * <pre>
   * The allocation and deallocation timeline.
   * </pre>
   *
   * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
   */
  public org.tensorflow.proto.framework.AllocationRecord getAllocationRecords(int index) {
    return allocationRecords_.get(index);
  }
  /**
   * <pre>
   * The allocation and deallocation timeline.
   * </pre>
   *
   * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
   */
  public org.tensorflow.proto.framework.AllocationRecordOrBuilder getAllocationRecordsOrBuilder(
      int index) {
    return allocationRecords_.get(index);
  }

  public static final int ALLOCATOR_BYTES_IN_USE_FIELD_NUMBER = 5;
  private long allocatorBytesInUse_;
  /**
   * <pre>
   * These are snapshots of the overall allocator memory stats.
   * The number of live bytes currently allocated by the allocator.
   * </pre>
   *
   * <code>int64 allocator_bytes_in_use = 5;</code>
   */
  public long getAllocatorBytesInUse() {
    return allocatorBytesInUse_;
  }

  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_);
    }
    if (totalBytes_ != 0L) {
      output.writeInt64(2, totalBytes_);
    }
    if (peakBytes_ != 0L) {
      output.writeInt64(3, peakBytes_);
    }
    if (liveBytes_ != 0L) {
      output.writeInt64(4, liveBytes_);
    }
    if (allocatorBytesInUse_ != 0L) {
      output.writeInt64(5, allocatorBytesInUse_);
    }
    for (int i = 0; i < allocationRecords_.size(); i++) {
      output.writeMessage(6, allocationRecords_.get(i));
    }
    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_);
    }
    if (totalBytes_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(2, totalBytes_);
    }
    if (peakBytes_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(3, peakBytes_);
    }
    if (liveBytes_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(4, liveBytes_);
    }
    if (allocatorBytesInUse_ != 0L) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt64Size(5, allocatorBytesInUse_);
    }
    for (int i = 0; i < allocationRecords_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(6, allocationRecords_.get(i));
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

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

    if (!getAllocatorName()
        .equals(other.getAllocatorName())) return false;
    if (getTotalBytes()
        != other.getTotalBytes()) return false;
    if (getPeakBytes()
        != other.getPeakBytes()) return false;
    if (getLiveBytes()
        != other.getLiveBytes()) return false;
    if (!getAllocationRecordsList()
        .equals(other.getAllocationRecordsList())) return false;
    if (getAllocatorBytesInUse()
        != other.getAllocatorBytesInUse()) 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();
    hash = (37 * hash) + TOTAL_BYTES_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getTotalBytes());
    hash = (37 * hash) + PEAK_BYTES_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getPeakBytes());
    hash = (37 * hash) + LIVE_BYTES_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getLiveBytes());
    if (getAllocationRecordsCount() > 0) {
      hash = (37 * hash) + ALLOCATION_RECORDS_FIELD_NUMBER;
      hash = (53 * hash) + getAllocationRecordsList().hashCode();
    }
    hash = (37 * hash) + ALLOCATOR_BYTES_IN_USE_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
        getAllocatorBytesInUse());
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

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

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

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

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

      totalBytes_ = 0L;

      peakBytes_ = 0L;

      liveBytes_ = 0L;

      if (allocationRecordsBuilder_ == null) {
        allocationRecords_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        allocationRecordsBuilder_.clear();
      }
      allocatorBytesInUse_ = 0L;

      return this;
    }

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

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

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

    @java.lang.Override
    public org.tensorflow.proto.framework.AllocatorMemoryUsed buildPartial() {
      org.tensorflow.proto.framework.AllocatorMemoryUsed result = new org.tensorflow.proto.framework.AllocatorMemoryUsed(this);
      int from_bitField0_ = bitField0_;
      result.allocatorName_ = allocatorName_;
      result.totalBytes_ = totalBytes_;
      result.peakBytes_ = peakBytes_;
      result.liveBytes_ = liveBytes_;
      if (allocationRecordsBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          allocationRecords_ = java.util.Collections.unmodifiableList(allocationRecords_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.allocationRecords_ = allocationRecords_;
      } else {
        result.allocationRecords_ = allocationRecordsBuilder_.build();
      }
      result.allocatorBytesInUse_ = allocatorBytesInUse_;
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(org.tensorflow.proto.framework.AllocatorMemoryUsed other) {
      if (other == org.tensorflow.proto.framework.AllocatorMemoryUsed.getDefaultInstance()) return this;
      if (!other.getAllocatorName().isEmpty()) {
        allocatorName_ = other.allocatorName_;
        onChanged();
      }
      if (other.getTotalBytes() != 0L) {
        setTotalBytes(other.getTotalBytes());
      }
      if (other.getPeakBytes() != 0L) {
        setPeakBytes(other.getPeakBytes());
      }
      if (other.getLiveBytes() != 0L) {
        setLiveBytes(other.getLiveBytes());
      }
      if (allocationRecordsBuilder_ == null) {
        if (!other.allocationRecords_.isEmpty()) {
          if (allocationRecords_.isEmpty()) {
            allocationRecords_ = other.allocationRecords_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureAllocationRecordsIsMutable();
            allocationRecords_.addAll(other.allocationRecords_);
          }
          onChanged();
        }
      } else {
        if (!other.allocationRecords_.isEmpty()) {
          if (allocationRecordsBuilder_.isEmpty()) {
            allocationRecordsBuilder_.dispose();
            allocationRecordsBuilder_ = null;
            allocationRecords_ = other.allocationRecords_;
            bitField0_ = (bitField0_ & ~0x00000001);
            allocationRecordsBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getAllocationRecordsFieldBuilder() : null;
          } else {
            allocationRecordsBuilder_.addAllMessages(other.allocationRecords_);
          }
        }
      }
      if (other.getAllocatorBytesInUse() != 0L) {
        setAllocatorBytesInUse(other.getAllocatorBytesInUse());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      org.tensorflow.proto.framework.AllocatorMemoryUsed parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.proto.framework.AllocatorMemoryUsed) 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 long totalBytes_ ;
    /**
     * <pre>
     * These are per-node allocator memory stats.
     * </pre>
     *
     * <code>int64 total_bytes = 2;</code>
     */
    public long getTotalBytes() {
      return totalBytes_;
    }
    /**
     * <pre>
     * These are per-node allocator memory stats.
     * </pre>
     *
     * <code>int64 total_bytes = 2;</code>
     */
    public Builder setTotalBytes(long value) {
      
      totalBytes_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * These are per-node allocator memory stats.
     * </pre>
     *
     * <code>int64 total_bytes = 2;</code>
     */
    public Builder clearTotalBytes() {
      
      totalBytes_ = 0L;
      onChanged();
      return this;
    }

    private long peakBytes_ ;
    /**
     * <code>int64 peak_bytes = 3;</code>
     */
    public long getPeakBytes() {
      return peakBytes_;
    }
    /**
     * <code>int64 peak_bytes = 3;</code>
     */
    public Builder setPeakBytes(long value) {
      
      peakBytes_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>int64 peak_bytes = 3;</code>
     */
    public Builder clearPeakBytes() {
      
      peakBytes_ = 0L;
      onChanged();
      return this;
    }

    private long liveBytes_ ;
    /**
     * <pre>
     * The bytes that are not deallocated.
     * </pre>
     *
     * <code>int64 live_bytes = 4;</code>
     */
    public long getLiveBytes() {
      return liveBytes_;
    }
    /**
     * <pre>
     * The bytes that are not deallocated.
     * </pre>
     *
     * <code>int64 live_bytes = 4;</code>
     */
    public Builder setLiveBytes(long value) {
      
      liveBytes_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * The bytes that are not deallocated.
     * </pre>
     *
     * <code>int64 live_bytes = 4;</code>
     */
    public Builder clearLiveBytes() {
      
      liveBytes_ = 0L;
      onChanged();
      return this;
    }

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

    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.framework.AllocationRecord, org.tensorflow.proto.framework.AllocationRecord.Builder, org.tensorflow.proto.framework.AllocationRecordOrBuilder> allocationRecordsBuilder_;

    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public java.util.List<org.tensorflow.proto.framework.AllocationRecord> getAllocationRecordsList() {
      if (allocationRecordsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(allocationRecords_);
      } else {
        return allocationRecordsBuilder_.getMessageList();
      }
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public int getAllocationRecordsCount() {
      if (allocationRecordsBuilder_ == null) {
        return allocationRecords_.size();
      } else {
        return allocationRecordsBuilder_.getCount();
      }
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public org.tensorflow.proto.framework.AllocationRecord getAllocationRecords(int index) {
      if (allocationRecordsBuilder_ == null) {
        return allocationRecords_.get(index);
      } else {
        return allocationRecordsBuilder_.getMessage(index);
      }
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public Builder setAllocationRecords(
        int index, org.tensorflow.proto.framework.AllocationRecord value) {
      if (allocationRecordsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureAllocationRecordsIsMutable();
        allocationRecords_.set(index, value);
        onChanged();
      } else {
        allocationRecordsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public Builder setAllocationRecords(
        int index, org.tensorflow.proto.framework.AllocationRecord.Builder builderForValue) {
      if (allocationRecordsBuilder_ == null) {
        ensureAllocationRecordsIsMutable();
        allocationRecords_.set(index, builderForValue.build());
        onChanged();
      } else {
        allocationRecordsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public Builder addAllocationRecords(org.tensorflow.proto.framework.AllocationRecord value) {
      if (allocationRecordsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureAllocationRecordsIsMutable();
        allocationRecords_.add(value);
        onChanged();
      } else {
        allocationRecordsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public Builder addAllocationRecords(
        int index, org.tensorflow.proto.framework.AllocationRecord value) {
      if (allocationRecordsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureAllocationRecordsIsMutable();
        allocationRecords_.add(index, value);
        onChanged();
      } else {
        allocationRecordsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public Builder addAllocationRecords(
        org.tensorflow.proto.framework.AllocationRecord.Builder builderForValue) {
      if (allocationRecordsBuilder_ == null) {
        ensureAllocationRecordsIsMutable();
        allocationRecords_.add(builderForValue.build());
        onChanged();
      } else {
        allocationRecordsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public Builder addAllocationRecords(
        int index, org.tensorflow.proto.framework.AllocationRecord.Builder builderForValue) {
      if (allocationRecordsBuilder_ == null) {
        ensureAllocationRecordsIsMutable();
        allocationRecords_.add(index, builderForValue.build());
        onChanged();
      } else {
        allocationRecordsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public Builder addAllAllocationRecords(
        java.lang.Iterable<? extends org.tensorflow.proto.framework.AllocationRecord> values) {
      if (allocationRecordsBuilder_ == null) {
        ensureAllocationRecordsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, allocationRecords_);
        onChanged();
      } else {
        allocationRecordsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public Builder clearAllocationRecords() {
      if (allocationRecordsBuilder_ == null) {
        allocationRecords_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        allocationRecordsBuilder_.clear();
      }
      return this;
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public Builder removeAllocationRecords(int index) {
      if (allocationRecordsBuilder_ == null) {
        ensureAllocationRecordsIsMutable();
        allocationRecords_.remove(index);
        onChanged();
      } else {
        allocationRecordsBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public org.tensorflow.proto.framework.AllocationRecord.Builder getAllocationRecordsBuilder(
        int index) {
      return getAllocationRecordsFieldBuilder().getBuilder(index);
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public org.tensorflow.proto.framework.AllocationRecordOrBuilder getAllocationRecordsOrBuilder(
        int index) {
      if (allocationRecordsBuilder_ == null) {
        return allocationRecords_.get(index);  } else {
        return allocationRecordsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public java.util.List<? extends org.tensorflow.proto.framework.AllocationRecordOrBuilder> 
         getAllocationRecordsOrBuilderList() {
      if (allocationRecordsBuilder_ != null) {
        return allocationRecordsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(allocationRecords_);
      }
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public org.tensorflow.proto.framework.AllocationRecord.Builder addAllocationRecordsBuilder() {
      return getAllocationRecordsFieldBuilder().addBuilder(
          org.tensorflow.proto.framework.AllocationRecord.getDefaultInstance());
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public org.tensorflow.proto.framework.AllocationRecord.Builder addAllocationRecordsBuilder(
        int index) {
      return getAllocationRecordsFieldBuilder().addBuilder(
          index, org.tensorflow.proto.framework.AllocationRecord.getDefaultInstance());
    }
    /**
     * <pre>
     * The allocation and deallocation timeline.
     * </pre>
     *
     * <code>repeated .tensorflow.AllocationRecord allocation_records = 6;</code>
     */
    public java.util.List<org.tensorflow.proto.framework.AllocationRecord.Builder> 
         getAllocationRecordsBuilderList() {
      return getAllocationRecordsFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.framework.AllocationRecord, org.tensorflow.proto.framework.AllocationRecord.Builder, org.tensorflow.proto.framework.AllocationRecordOrBuilder> 
        getAllocationRecordsFieldBuilder() {
      if (allocationRecordsBuilder_ == null) {
        allocationRecordsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            org.tensorflow.proto.framework.AllocationRecord, org.tensorflow.proto.framework.AllocationRecord.Builder, org.tensorflow.proto.framework.AllocationRecordOrBuilder>(
                allocationRecords_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        allocationRecords_ = null;
      }
      return allocationRecordsBuilder_;
    }

    private long allocatorBytesInUse_ ;
    /**
     * <pre>
     * These are snapshots of the overall allocator memory stats.
     * The number of live bytes currently allocated by the allocator.
     * </pre>
     *
     * <code>int64 allocator_bytes_in_use = 5;</code>
     */
    public long getAllocatorBytesInUse() {
      return allocatorBytesInUse_;
    }
    /**
     * <pre>
     * These are snapshots of the overall allocator memory stats.
     * The number of live bytes currently allocated by the allocator.
     * </pre>
     *
     * <code>int64 allocator_bytes_in_use = 5;</code>
     */
    public Builder setAllocatorBytesInUse(long value) {
      
      allocatorBytesInUse_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * These are snapshots of the overall allocator memory stats.
     * The number of live bytes currently allocated by the allocator.
     * </pre>
     *
     * <code>int64 allocator_bytes_in_use = 5;</code>
     */
    public Builder clearAllocatorBytesInUse() {
      
      allocatorBytesInUse_ = 0L;
      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.AllocatorMemoryUsed)
  }

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

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

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

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

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

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

}

