// 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.DeviceStepStats}
 */
public  final class DeviceStepStats extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.DeviceStepStats)
    DeviceStepStatsOrBuilder {
private static final long serialVersionUID = 0L;
  // Use DeviceStepStats.newBuilder() to construct.
  private DeviceStepStats(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private DeviceStepStats() {
    device_ = "";
    nodeStats_ = java.util.Collections.emptyList();
  }

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

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

            device_ = s;
            break;
          }
          case 18: {
            if (!((mutable_bitField0_ & 0x00000001) != 0)) {
              nodeStats_ = new java.util.ArrayList<org.tensorflow.proto.framework.NodeExecStats>();
              mutable_bitField0_ |= 0x00000001;
            }
            nodeStats_.add(
                input.readMessage(org.tensorflow.proto.framework.NodeExecStats.parser(), extensionRegistry));
            break;
          }
          case 26: {
            if (!((mutable_bitField0_ & 0x00000002) != 0)) {
              threadNames_ = com.google.protobuf.MapField.newMapField(
                  ThreadNamesDefaultEntryHolder.defaultEntry);
              mutable_bitField0_ |= 0x00000002;
            }
            com.google.protobuf.MapEntry<java.lang.Integer, java.lang.String>
            threadNames__ = input.readMessage(
                ThreadNamesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
            threadNames_.getMutableMap().put(
                threadNames__.getKey(), threadNames__.getValue());
            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)) {
        nodeStats_ = java.util.Collections.unmodifiableList(nodeStats_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(
      int number) {
    switch (number) {
      case 3:
        return internalGetThreadNames();
      default:
        throw new RuntimeException(
            "Invalid map field number: " + number);
    }
  }
  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            org.tensorflow.proto.framework.DeviceStepStats.class, org.tensorflow.proto.framework.DeviceStepStats.Builder.class);
  }

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

  public static final int NODE_STATS_FIELD_NUMBER = 2;
  private java.util.List<org.tensorflow.proto.framework.NodeExecStats> nodeStats_;
  /**
   * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
   */
  public java.util.List<org.tensorflow.proto.framework.NodeExecStats> getNodeStatsList() {
    return nodeStats_;
  }
  /**
   * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
   */
  public java.util.List<? extends org.tensorflow.proto.framework.NodeExecStatsOrBuilder> 
      getNodeStatsOrBuilderList() {
    return nodeStats_;
  }
  /**
   * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
   */
  public int getNodeStatsCount() {
    return nodeStats_.size();
  }
  /**
   * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
   */
  public org.tensorflow.proto.framework.NodeExecStats getNodeStats(int index) {
    return nodeStats_.get(index);
  }
  /**
   * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
   */
  public org.tensorflow.proto.framework.NodeExecStatsOrBuilder getNodeStatsOrBuilder(
      int index) {
    return nodeStats_.get(index);
  }

  public static final int THREAD_NAMES_FIELD_NUMBER = 3;
  private static final class ThreadNamesDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<
        java.lang.Integer, java.lang.String> defaultEntry =
            com.google.protobuf.MapEntry
            .<java.lang.Integer, java.lang.String>newDefaultInstance(
                org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_ThreadNamesEntry_descriptor, 
                com.google.protobuf.WireFormat.FieldType.UINT32,
                0,
                com.google.protobuf.WireFormat.FieldType.STRING,
                "");
  }
  private com.google.protobuf.MapField<
      java.lang.Integer, java.lang.String> threadNames_;
  private com.google.protobuf.MapField<java.lang.Integer, java.lang.String>
  internalGetThreadNames() {
    if (threadNames_ == null) {
      return com.google.protobuf.MapField.emptyMapField(
          ThreadNamesDefaultEntryHolder.defaultEntry);
    }
    return threadNames_;
  }

  public int getThreadNamesCount() {
    return internalGetThreadNames().getMap().size();
  }
  /**
   * <pre>
   * Its key is thread id.
   * </pre>
   *
   * <code>map&lt;uint32, string&gt; thread_names = 3;</code>
   */

  public boolean containsThreadNames(
      int key) {
    
    return internalGetThreadNames().getMap().containsKey(key);
  }
  /**
   * Use {@link #getThreadNamesMap()} instead.
   */
  @java.lang.Deprecated
  public java.util.Map<java.lang.Integer, java.lang.String> getThreadNames() {
    return getThreadNamesMap();
  }
  /**
   * <pre>
   * Its key is thread id.
   * </pre>
   *
   * <code>map&lt;uint32, string&gt; thread_names = 3;</code>
   */

  public java.util.Map<java.lang.Integer, java.lang.String> getThreadNamesMap() {
    return internalGetThreadNames().getMap();
  }
  /**
   * <pre>
   * Its key is thread id.
   * </pre>
   *
   * <code>map&lt;uint32, string&gt; thread_names = 3;</code>
   */

  public java.lang.String getThreadNamesOrDefault(
      int key,
      java.lang.String defaultValue) {
    
    java.util.Map<java.lang.Integer, java.lang.String> map =
        internalGetThreadNames().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   * <pre>
   * Its key is thread id.
   * </pre>
   *
   * <code>map&lt;uint32, string&gt; thread_names = 3;</code>
   */

  public java.lang.String getThreadNamesOrThrow(
      int key) {
    
    java.util.Map<java.lang.Integer, java.lang.String> map =
        internalGetThreadNames().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  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 (!getDeviceBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, device_);
    }
    for (int i = 0; i < nodeStats_.size(); i++) {
      output.writeMessage(2, nodeStats_.get(i));
    }
    com.google.protobuf.GeneratedMessageV3
      .serializeIntegerMapTo(
        output,
        internalGetThreadNames(),
        ThreadNamesDefaultEntryHolder.defaultEntry,
        3);
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getDeviceBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, device_);
    }
    for (int i = 0; i < nodeStats_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, nodeStats_.get(i));
    }
    for (java.util.Map.Entry<java.lang.Integer, java.lang.String> entry
         : internalGetThreadNames().getMap().entrySet()) {
      com.google.protobuf.MapEntry<java.lang.Integer, java.lang.String>
      threadNames__ = ThreadNamesDefaultEntryHolder.defaultEntry.newBuilderForType()
          .setKey(entry.getKey())
          .setValue(entry.getValue())
          .build();
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(3, threadNames__);
    }
    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.DeviceStepStats)) {
      return super.equals(obj);
    }
    org.tensorflow.proto.framework.DeviceStepStats other = (org.tensorflow.proto.framework.DeviceStepStats) obj;

    if (!getDevice()
        .equals(other.getDevice())) return false;
    if (!getNodeStatsList()
        .equals(other.getNodeStatsList())) return false;
    if (!internalGetThreadNames().equals(
        other.internalGetThreadNames())) 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) + DEVICE_FIELD_NUMBER;
    hash = (53 * hash) + getDevice().hashCode();
    if (getNodeStatsCount() > 0) {
      hash = (37 * hash) + NODE_STATS_FIELD_NUMBER;
      hash = (53 * hash) + getNodeStatsList().hashCode();
    }
    if (!internalGetThreadNames().getMap().isEmpty()) {
      hash = (37 * hash) + THREAD_NAMES_FIELD_NUMBER;
      hash = (53 * hash) + internalGetThreadNames().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 3:
          return internalGetThreadNames();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(
        int number) {
      switch (number) {
        case 3:
          return internalGetMutableThreadNames();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.framework.StepStatsProtos.internal_static_tensorflow_DeviceStepStats_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.framework.DeviceStepStats.class, org.tensorflow.proto.framework.DeviceStepStats.Builder.class);
    }

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

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

      if (nodeStatsBuilder_ == null) {
        nodeStats_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        nodeStatsBuilder_.clear();
      }
      internalGetMutableThreadNames().clear();
      return this;
    }

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

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

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

    @java.lang.Override
    public org.tensorflow.proto.framework.DeviceStepStats buildPartial() {
      org.tensorflow.proto.framework.DeviceStepStats result = new org.tensorflow.proto.framework.DeviceStepStats(this);
      int from_bitField0_ = bitField0_;
      result.device_ = device_;
      if (nodeStatsBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          nodeStats_ = java.util.Collections.unmodifiableList(nodeStats_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.nodeStats_ = nodeStats_;
      } else {
        result.nodeStats_ = nodeStatsBuilder_.build();
      }
      result.threadNames_ = internalGetThreadNames();
      result.threadNames_.makeImmutable();
      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.DeviceStepStats) {
        return mergeFrom((org.tensorflow.proto.framework.DeviceStepStats)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(org.tensorflow.proto.framework.DeviceStepStats other) {
      if (other == org.tensorflow.proto.framework.DeviceStepStats.getDefaultInstance()) return this;
      if (!other.getDevice().isEmpty()) {
        device_ = other.device_;
        onChanged();
      }
      if (nodeStatsBuilder_ == null) {
        if (!other.nodeStats_.isEmpty()) {
          if (nodeStats_.isEmpty()) {
            nodeStats_ = other.nodeStats_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureNodeStatsIsMutable();
            nodeStats_.addAll(other.nodeStats_);
          }
          onChanged();
        }
      } else {
        if (!other.nodeStats_.isEmpty()) {
          if (nodeStatsBuilder_.isEmpty()) {
            nodeStatsBuilder_.dispose();
            nodeStatsBuilder_ = null;
            nodeStats_ = other.nodeStats_;
            bitField0_ = (bitField0_ & ~0x00000001);
            nodeStatsBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getNodeStatsFieldBuilder() : null;
          } else {
            nodeStatsBuilder_.addAllMessages(other.nodeStats_);
          }
        }
      }
      internalGetMutableThreadNames().mergeFrom(
          other.internalGetThreadNames());
      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.DeviceStepStats parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.tensorflow.proto.framework.DeviceStepStats) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.lang.Object device_ = "";
    /**
     * <code>string device = 1;</code>
     */
    public java.lang.String getDevice() {
      java.lang.Object ref = device_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        device_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>string device = 1;</code>
     */
    public com.google.protobuf.ByteString
        getDeviceBytes() {
      java.lang.Object ref = device_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        device_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>string device = 1;</code>
     */
    public Builder setDevice(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      device_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>string device = 1;</code>
     */
    public Builder clearDevice() {
      
      device_ = getDefaultInstance().getDevice();
      onChanged();
      return this;
    }
    /**
     * <code>string device = 1;</code>
     */
    public Builder setDeviceBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      device_ = value;
      onChanged();
      return this;
    }

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

    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.framework.NodeExecStats, org.tensorflow.proto.framework.NodeExecStats.Builder, org.tensorflow.proto.framework.NodeExecStatsOrBuilder> nodeStatsBuilder_;

    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public java.util.List<org.tensorflow.proto.framework.NodeExecStats> getNodeStatsList() {
      if (nodeStatsBuilder_ == null) {
        return java.util.Collections.unmodifiableList(nodeStats_);
      } else {
        return nodeStatsBuilder_.getMessageList();
      }
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public int getNodeStatsCount() {
      if (nodeStatsBuilder_ == null) {
        return nodeStats_.size();
      } else {
        return nodeStatsBuilder_.getCount();
      }
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public org.tensorflow.proto.framework.NodeExecStats getNodeStats(int index) {
      if (nodeStatsBuilder_ == null) {
        return nodeStats_.get(index);
      } else {
        return nodeStatsBuilder_.getMessage(index);
      }
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public Builder setNodeStats(
        int index, org.tensorflow.proto.framework.NodeExecStats value) {
      if (nodeStatsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureNodeStatsIsMutable();
        nodeStats_.set(index, value);
        onChanged();
      } else {
        nodeStatsBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public Builder setNodeStats(
        int index, org.tensorflow.proto.framework.NodeExecStats.Builder builderForValue) {
      if (nodeStatsBuilder_ == null) {
        ensureNodeStatsIsMutable();
        nodeStats_.set(index, builderForValue.build());
        onChanged();
      } else {
        nodeStatsBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public Builder addNodeStats(org.tensorflow.proto.framework.NodeExecStats value) {
      if (nodeStatsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureNodeStatsIsMutable();
        nodeStats_.add(value);
        onChanged();
      } else {
        nodeStatsBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public Builder addNodeStats(
        int index, org.tensorflow.proto.framework.NodeExecStats value) {
      if (nodeStatsBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureNodeStatsIsMutable();
        nodeStats_.add(index, value);
        onChanged();
      } else {
        nodeStatsBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public Builder addNodeStats(
        org.tensorflow.proto.framework.NodeExecStats.Builder builderForValue) {
      if (nodeStatsBuilder_ == null) {
        ensureNodeStatsIsMutable();
        nodeStats_.add(builderForValue.build());
        onChanged();
      } else {
        nodeStatsBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public Builder addNodeStats(
        int index, org.tensorflow.proto.framework.NodeExecStats.Builder builderForValue) {
      if (nodeStatsBuilder_ == null) {
        ensureNodeStatsIsMutable();
        nodeStats_.add(index, builderForValue.build());
        onChanged();
      } else {
        nodeStatsBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public Builder addAllNodeStats(
        java.lang.Iterable<? extends org.tensorflow.proto.framework.NodeExecStats> values) {
      if (nodeStatsBuilder_ == null) {
        ensureNodeStatsIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, nodeStats_);
        onChanged();
      } else {
        nodeStatsBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public Builder clearNodeStats() {
      if (nodeStatsBuilder_ == null) {
        nodeStats_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        nodeStatsBuilder_.clear();
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public Builder removeNodeStats(int index) {
      if (nodeStatsBuilder_ == null) {
        ensureNodeStatsIsMutable();
        nodeStats_.remove(index);
        onChanged();
      } else {
        nodeStatsBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public org.tensorflow.proto.framework.NodeExecStats.Builder getNodeStatsBuilder(
        int index) {
      return getNodeStatsFieldBuilder().getBuilder(index);
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public org.tensorflow.proto.framework.NodeExecStatsOrBuilder getNodeStatsOrBuilder(
        int index) {
      if (nodeStatsBuilder_ == null) {
        return nodeStats_.get(index);  } else {
        return nodeStatsBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public java.util.List<? extends org.tensorflow.proto.framework.NodeExecStatsOrBuilder> 
         getNodeStatsOrBuilderList() {
      if (nodeStatsBuilder_ != null) {
        return nodeStatsBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(nodeStats_);
      }
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public org.tensorflow.proto.framework.NodeExecStats.Builder addNodeStatsBuilder() {
      return getNodeStatsFieldBuilder().addBuilder(
          org.tensorflow.proto.framework.NodeExecStats.getDefaultInstance());
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public org.tensorflow.proto.framework.NodeExecStats.Builder addNodeStatsBuilder(
        int index) {
      return getNodeStatsFieldBuilder().addBuilder(
          index, org.tensorflow.proto.framework.NodeExecStats.getDefaultInstance());
    }
    /**
     * <code>repeated .tensorflow.NodeExecStats node_stats = 2;</code>
     */
    public java.util.List<org.tensorflow.proto.framework.NodeExecStats.Builder> 
         getNodeStatsBuilderList() {
      return getNodeStatsFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.framework.NodeExecStats, org.tensorflow.proto.framework.NodeExecStats.Builder, org.tensorflow.proto.framework.NodeExecStatsOrBuilder> 
        getNodeStatsFieldBuilder() {
      if (nodeStatsBuilder_ == null) {
        nodeStatsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            org.tensorflow.proto.framework.NodeExecStats, org.tensorflow.proto.framework.NodeExecStats.Builder, org.tensorflow.proto.framework.NodeExecStatsOrBuilder>(
                nodeStats_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        nodeStats_ = null;
      }
      return nodeStatsBuilder_;
    }

    private com.google.protobuf.MapField<
        java.lang.Integer, java.lang.String> threadNames_;
    private com.google.protobuf.MapField<java.lang.Integer, java.lang.String>
    internalGetThreadNames() {
      if (threadNames_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            ThreadNamesDefaultEntryHolder.defaultEntry);
      }
      return threadNames_;
    }
    private com.google.protobuf.MapField<java.lang.Integer, java.lang.String>
    internalGetMutableThreadNames() {
      onChanged();;
      if (threadNames_ == null) {
        threadNames_ = com.google.protobuf.MapField.newMapField(
            ThreadNamesDefaultEntryHolder.defaultEntry);
      }
      if (!threadNames_.isMutable()) {
        threadNames_ = threadNames_.copy();
      }
      return threadNames_;
    }

    public int getThreadNamesCount() {
      return internalGetThreadNames().getMap().size();
    }
    /**
     * <pre>
     * Its key is thread id.
     * </pre>
     *
     * <code>map&lt;uint32, string&gt; thread_names = 3;</code>
     */

    public boolean containsThreadNames(
        int key) {
      
      return internalGetThreadNames().getMap().containsKey(key);
    }
    /**
     * Use {@link #getThreadNamesMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.Integer, java.lang.String> getThreadNames() {
      return getThreadNamesMap();
    }
    /**
     * <pre>
     * Its key is thread id.
     * </pre>
     *
     * <code>map&lt;uint32, string&gt; thread_names = 3;</code>
     */

    public java.util.Map<java.lang.Integer, java.lang.String> getThreadNamesMap() {
      return internalGetThreadNames().getMap();
    }
    /**
     * <pre>
     * Its key is thread id.
     * </pre>
     *
     * <code>map&lt;uint32, string&gt; thread_names = 3;</code>
     */

    public java.lang.String getThreadNamesOrDefault(
        int key,
        java.lang.String defaultValue) {
      
      java.util.Map<java.lang.Integer, java.lang.String> map =
          internalGetThreadNames().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * Its key is thread id.
     * </pre>
     *
     * <code>map&lt;uint32, string&gt; thread_names = 3;</code>
     */

    public java.lang.String getThreadNamesOrThrow(
        int key) {
      
      java.util.Map<java.lang.Integer, java.lang.String> map =
          internalGetThreadNames().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearThreadNames() {
      internalGetMutableThreadNames().getMutableMap()
          .clear();
      return this;
    }
    /**
     * <pre>
     * Its key is thread id.
     * </pre>
     *
     * <code>map&lt;uint32, string&gt; thread_names = 3;</code>
     */

    public Builder removeThreadNames(
        int key) {
      
      internalGetMutableThreadNames().getMutableMap()
          .remove(key);
      return this;
    }
    /**
     * Use alternate mutation accessors instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.Integer, java.lang.String>
    getMutableThreadNames() {
      return internalGetMutableThreadNames().getMutableMap();
    }
    /**
     * <pre>
     * Its key is thread id.
     * </pre>
     *
     * <code>map&lt;uint32, string&gt; thread_names = 3;</code>
     */
    public Builder putThreadNames(
        int key,
        java.lang.String value) {
      
      if (value == null) { throw new java.lang.NullPointerException(); }
      internalGetMutableThreadNames().getMutableMap()
          .put(key, value);
      return this;
    }
    /**
     * <pre>
     * Its key is thread id.
     * </pre>
     *
     * <code>map&lt;uint32, string&gt; thread_names = 3;</code>
     */

    public Builder putAllThreadNames(
        java.util.Map<java.lang.Integer, java.lang.String> values) {
      internalGetMutableThreadNames().getMutableMap()
          .putAll(values);
      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.DeviceStepStats)
  }

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

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

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

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

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

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

}

