// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow/contrib/tpu/profiler/trace_events.proto

package tensorflow.tpu;

public final class TraceEvents {
  private TraceEvents() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistryLite registry) {
  }

  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
    registerAllExtensions(
        (com.google.protobuf.ExtensionRegistryLite) registry);
  }
  public interface TraceOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.tpu.Trace)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * The devices that this trace has information about. Maps from device_id to
     * more data about the specific device.
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
     */
    int getDevicesCount();
    /**
     * <pre>
     * The devices that this trace has information about. Maps from device_id to
     * more data about the specific device.
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
     */
    boolean containsDevices(
        int key);
    /**
     * Use {@link #getDevicesMap()} instead.
     */
    @java.lang.Deprecated
    java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Device>
    getDevices();
    /**
     * <pre>
     * The devices that this trace has information about. Maps from device_id to
     * more data about the specific device.
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
     */
    java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Device>
    getDevicesMap();
    /**
     * <pre>
     * The devices that this trace has information about. Maps from device_id to
     * more data about the specific device.
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
     */

    tensorflow.tpu.TraceEvents.Device getDevicesOrDefault(
        int key,
        tensorflow.tpu.TraceEvents.Device defaultValue);
    /**
     * <pre>
     * The devices that this trace has information about. Maps from device_id to
     * more data about the specific device.
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
     */

    tensorflow.tpu.TraceEvents.Device getDevicesOrThrow(
        int key);

    /**
     * <pre>
     * All trace events capturing in the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
     */
    java.util.List<tensorflow.tpu.TraceEvents.TraceEvent> 
        getTraceEventsList();
    /**
     * <pre>
     * All trace events capturing in the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
     */
    tensorflow.tpu.TraceEvents.TraceEvent getTraceEvents(int index);
    /**
     * <pre>
     * All trace events capturing in the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
     */
    int getTraceEventsCount();
    /**
     * <pre>
     * All trace events capturing in the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
     */
    java.util.List<? extends tensorflow.tpu.TraceEvents.TraceEventOrBuilder> 
        getTraceEventsOrBuilderList();
    /**
     * <pre>
     * All trace events capturing in the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
     */
    tensorflow.tpu.TraceEvents.TraceEventOrBuilder getTraceEventsOrBuilder(
        int index);
  }
  /**
   * <pre>
   * A 'Trace' contains metadata for the individual traces of a system.
   * </pre>
   *
   * Protobuf type {@code tensorflow.tpu.Trace}
   */
  public  static final class Trace extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.tpu.Trace)
      TraceOrBuilder {
    // Use Trace.newBuilder() to construct.
    private Trace(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private Trace() {
      traceEvents_ = java.util.Collections.emptyList();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
    }
    private Trace(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      int mutable_bitField0_ = 0;
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!input.skipField(tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
                devices_ = com.google.protobuf.MapField.newMapField(
                    DevicesDefaultEntryHolder.defaultEntry);
                mutable_bitField0_ |= 0x00000001;
              }
              com.google.protobuf.MapEntry<java.lang.Integer, tensorflow.tpu.TraceEvents.Device>
              devices__ = input.readMessage(
                  DevicesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
              devices_.getMutableMap().put(
                  devices__.getKey(), devices__.getValue());
              break;
            }
            case 34: {
              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
                traceEvents_ = new java.util.ArrayList<tensorflow.tpu.TraceEvents.TraceEvent>();
                mutable_bitField0_ |= 0x00000002;
              }
              traceEvents_.add(
                  input.readMessage(tensorflow.tpu.TraceEvents.TraceEvent.parser(), extensionRegistry));
              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_ & 0x00000002) == 0x00000002)) {
          traceEvents_ = java.util.Collections.unmodifiableList(traceEvents_);
        }
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Trace_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 1:
          return internalGetDevices();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Trace_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              tensorflow.tpu.TraceEvents.Trace.class, tensorflow.tpu.TraceEvents.Trace.Builder.class);
    }

    public static final int DEVICES_FIELD_NUMBER = 1;
    private static final class DevicesDefaultEntryHolder {
      static final com.google.protobuf.MapEntry<
          java.lang.Integer, tensorflow.tpu.TraceEvents.Device> defaultEntry =
              com.google.protobuf.MapEntry
              .<java.lang.Integer, tensorflow.tpu.TraceEvents.Device>newDefaultInstance(
                  tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Trace_DevicesEntry_descriptor, 
                  com.google.protobuf.WireFormat.FieldType.UINT32,
                  0,
                  com.google.protobuf.WireFormat.FieldType.MESSAGE,
                  tensorflow.tpu.TraceEvents.Device.getDefaultInstance());
    }
    private com.google.protobuf.MapField<
        java.lang.Integer, tensorflow.tpu.TraceEvents.Device> devices_;
    private com.google.protobuf.MapField<java.lang.Integer, tensorflow.tpu.TraceEvents.Device>
    internalGetDevices() {
      if (devices_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            DevicesDefaultEntryHolder.defaultEntry);
      }
      return devices_;
    }

    public int getDevicesCount() {
      return internalGetDevices().getMap().size();
    }
    /**
     * <pre>
     * The devices that this trace has information about. Maps from device_id to
     * more data about the specific device.
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
     */

    public boolean containsDevices(
        int key) {
      
      return internalGetDevices().getMap().containsKey(key);
    }
    /**
     * Use {@link #getDevicesMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Device> getDevices() {
      return getDevicesMap();
    }
    /**
     * <pre>
     * The devices that this trace has information about. Maps from device_id to
     * more data about the specific device.
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
     */

    public java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Device> getDevicesMap() {
      return internalGetDevices().getMap();
    }
    /**
     * <pre>
     * The devices that this trace has information about. Maps from device_id to
     * more data about the specific device.
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
     */

    public tensorflow.tpu.TraceEvents.Device getDevicesOrDefault(
        int key,
        tensorflow.tpu.TraceEvents.Device defaultValue) {
      
      java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Device> map =
          internalGetDevices().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * The devices that this trace has information about. Maps from device_id to
     * more data about the specific device.
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
     */

    public tensorflow.tpu.TraceEvents.Device getDevicesOrThrow(
        int key) {
      
      java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Device> map =
          internalGetDevices().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public static final int TRACE_EVENTS_FIELD_NUMBER = 4;
    private java.util.List<tensorflow.tpu.TraceEvents.TraceEvent> traceEvents_;
    /**
     * <pre>
     * All trace events capturing in the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
     */
    public java.util.List<tensorflow.tpu.TraceEvents.TraceEvent> getTraceEventsList() {
      return traceEvents_;
    }
    /**
     * <pre>
     * All trace events capturing in the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
     */
    public java.util.List<? extends tensorflow.tpu.TraceEvents.TraceEventOrBuilder> 
        getTraceEventsOrBuilderList() {
      return traceEvents_;
    }
    /**
     * <pre>
     * All trace events capturing in the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
     */
    public int getTraceEventsCount() {
      return traceEvents_.size();
    }
    /**
     * <pre>
     * All trace events capturing in the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
     */
    public tensorflow.tpu.TraceEvents.TraceEvent getTraceEvents(int index) {
      return traceEvents_.get(index);
    }
    /**
     * <pre>
     * All trace events capturing in the profiling period.
     * </pre>
     *
     * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
     */
    public tensorflow.tpu.TraceEvents.TraceEventOrBuilder getTraceEventsOrBuilder(
        int index) {
      return traceEvents_.get(index);
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      com.google.protobuf.GeneratedMessageV3
        .serializeIntegerMapTo(
          output,
          internalGetDevices(),
          DevicesDefaultEntryHolder.defaultEntry,
          1);
      for (int i = 0; i < traceEvents_.size(); i++) {
        output.writeMessage(4, traceEvents_.get(i));
      }
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      for (java.util.Map.Entry<java.lang.Integer, tensorflow.tpu.TraceEvents.Device> entry
           : internalGetDevices().getMap().entrySet()) {
        com.google.protobuf.MapEntry<java.lang.Integer, tensorflow.tpu.TraceEvents.Device>
        devices__ = DevicesDefaultEntryHolder.defaultEntry.newBuilderForType()
            .setKey(entry.getKey())
            .setValue(entry.getValue())
            .build();
        size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(1, devices__);
      }
      for (int i = 0; i < traceEvents_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(4, traceEvents_.get(i));
      }
      memoizedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof tensorflow.tpu.TraceEvents.Trace)) {
        return super.equals(obj);
      }
      tensorflow.tpu.TraceEvents.Trace other = (tensorflow.tpu.TraceEvents.Trace) obj;

      boolean result = true;
      result = result && internalGetDevices().equals(
          other.internalGetDevices());
      result = result && getTraceEventsList()
          .equals(other.getTraceEventsList());
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      if (!internalGetDevices().getMap().isEmpty()) {
        hash = (37 * hash) + DEVICES_FIELD_NUMBER;
        hash = (53 * hash) + internalGetDevices().hashCode();
      }
      if (getTraceEventsCount() > 0) {
        hash = (37 * hash) + TRACE_EVENTS_FIELD_NUMBER;
        hash = (53 * hash) + getTraceEventsList().hashCode();
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

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

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(tensorflow.tpu.TraceEvents.Trace prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * <pre>
     * A 'Trace' contains metadata for the individual traces of a system.
     * </pre>
     *
     * Protobuf type {@code tensorflow.tpu.Trace}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.tpu.Trace)
        tensorflow.tpu.TraceEvents.TraceOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Trace_descriptor;
      }

      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMapField(
          int number) {
        switch (number) {
          case 1:
            return internalGetDevices();
          default:
            throw new RuntimeException(
                "Invalid map field number: " + number);
        }
      }
      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMutableMapField(
          int number) {
        switch (number) {
          case 1:
            return internalGetMutableDevices();
          default:
            throw new RuntimeException(
                "Invalid map field number: " + number);
        }
      }
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Trace_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                tensorflow.tpu.TraceEvents.Trace.class, tensorflow.tpu.TraceEvents.Trace.Builder.class);
      }

      // Construct using tensorflow.tpu.TraceEvents.Trace.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
          getTraceEventsFieldBuilder();
        }
      }
      public Builder clear() {
        super.clear();
        internalGetMutableDevices().clear();
        if (traceEventsBuilder_ == null) {
          traceEvents_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          traceEventsBuilder_.clear();
        }
        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Trace_descriptor;
      }

      public tensorflow.tpu.TraceEvents.Trace getDefaultInstanceForType() {
        return tensorflow.tpu.TraceEvents.Trace.getDefaultInstance();
      }

      public tensorflow.tpu.TraceEvents.Trace build() {
        tensorflow.tpu.TraceEvents.Trace result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public tensorflow.tpu.TraceEvents.Trace buildPartial() {
        tensorflow.tpu.TraceEvents.Trace result = new tensorflow.tpu.TraceEvents.Trace(this);
        int from_bitField0_ = bitField0_;
        result.devices_ = internalGetDevices();
        result.devices_.makeImmutable();
        if (traceEventsBuilder_ == null) {
          if (((bitField0_ & 0x00000002) == 0x00000002)) {
            traceEvents_ = java.util.Collections.unmodifiableList(traceEvents_);
            bitField0_ = (bitField0_ & ~0x00000002);
          }
          result.traceEvents_ = traceEvents_;
        } else {
          result.traceEvents_ = traceEventsBuilder_.build();
        }
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof tensorflow.tpu.TraceEvents.Trace) {
          return mergeFrom((tensorflow.tpu.TraceEvents.Trace)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(tensorflow.tpu.TraceEvents.Trace other) {
        if (other == tensorflow.tpu.TraceEvents.Trace.getDefaultInstance()) return this;
        internalGetMutableDevices().mergeFrom(
            other.internalGetDevices());
        if (traceEventsBuilder_ == null) {
          if (!other.traceEvents_.isEmpty()) {
            if (traceEvents_.isEmpty()) {
              traceEvents_ = other.traceEvents_;
              bitField0_ = (bitField0_ & ~0x00000002);
            } else {
              ensureTraceEventsIsMutable();
              traceEvents_.addAll(other.traceEvents_);
            }
            onChanged();
          }
        } else {
          if (!other.traceEvents_.isEmpty()) {
            if (traceEventsBuilder_.isEmpty()) {
              traceEventsBuilder_.dispose();
              traceEventsBuilder_ = null;
              traceEvents_ = other.traceEvents_;
              bitField0_ = (bitField0_ & ~0x00000002);
              traceEventsBuilder_ = 
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                   getTraceEventsFieldBuilder() : null;
            } else {
              traceEventsBuilder_.addAllMessages(other.traceEvents_);
            }
          }
        }
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        tensorflow.tpu.TraceEvents.Trace parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (tensorflow.tpu.TraceEvents.Trace) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      private com.google.protobuf.MapField<
          java.lang.Integer, tensorflow.tpu.TraceEvents.Device> devices_;
      private com.google.protobuf.MapField<java.lang.Integer, tensorflow.tpu.TraceEvents.Device>
      internalGetDevices() {
        if (devices_ == null) {
          return com.google.protobuf.MapField.emptyMapField(
              DevicesDefaultEntryHolder.defaultEntry);
        }
        return devices_;
      }
      private com.google.protobuf.MapField<java.lang.Integer, tensorflow.tpu.TraceEvents.Device>
      internalGetMutableDevices() {
        onChanged();;
        if (devices_ == null) {
          devices_ = com.google.protobuf.MapField.newMapField(
              DevicesDefaultEntryHolder.defaultEntry);
        }
        if (!devices_.isMutable()) {
          devices_ = devices_.copy();
        }
        return devices_;
      }

      public int getDevicesCount() {
        return internalGetDevices().getMap().size();
      }
      /**
       * <pre>
       * The devices that this trace has information about. Maps from device_id to
       * more data about the specific device.
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
       */

      public boolean containsDevices(
          int key) {
        
        return internalGetDevices().getMap().containsKey(key);
      }
      /**
       * Use {@link #getDevicesMap()} instead.
       */
      @java.lang.Deprecated
      public java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Device> getDevices() {
        return getDevicesMap();
      }
      /**
       * <pre>
       * The devices that this trace has information about. Maps from device_id to
       * more data about the specific device.
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
       */

      public java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Device> getDevicesMap() {
        return internalGetDevices().getMap();
      }
      /**
       * <pre>
       * The devices that this trace has information about. Maps from device_id to
       * more data about the specific device.
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
       */

      public tensorflow.tpu.TraceEvents.Device getDevicesOrDefault(
          int key,
          tensorflow.tpu.TraceEvents.Device defaultValue) {
        
        java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Device> map =
            internalGetDevices().getMap();
        return map.containsKey(key) ? map.get(key) : defaultValue;
      }
      /**
       * <pre>
       * The devices that this trace has information about. Maps from device_id to
       * more data about the specific device.
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
       */

      public tensorflow.tpu.TraceEvents.Device getDevicesOrThrow(
          int key) {
        
        java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Device> map =
            internalGetDevices().getMap();
        if (!map.containsKey(key)) {
          throw new java.lang.IllegalArgumentException();
        }
        return map.get(key);
      }

      public Builder clearDevices() {
        internalGetMutableDevices().getMutableMap()
            .clear();
        return this;
      }
      /**
       * <pre>
       * The devices that this trace has information about. Maps from device_id to
       * more data about the specific device.
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
       */

      public Builder removeDevices(
          int key) {
        
        internalGetMutableDevices().getMutableMap()
            .remove(key);
        return this;
      }
      /**
       * Use alternate mutation accessors instead.
       */
      @java.lang.Deprecated
      public java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Device>
      getMutableDevices() {
        return internalGetMutableDevices().getMutableMap();
      }
      /**
       * <pre>
       * The devices that this trace has information about. Maps from device_id to
       * more data about the specific device.
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
       */
      public Builder putDevices(
          int key,
          tensorflow.tpu.TraceEvents.Device value) {
        
        if (value == null) { throw new java.lang.NullPointerException(); }
        internalGetMutableDevices().getMutableMap()
            .put(key, value);
        return this;
      }
      /**
       * <pre>
       * The devices that this trace has information about. Maps from device_id to
       * more data about the specific device.
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Device&gt; devices = 1;</code>
       */

      public Builder putAllDevices(
          java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Device> values) {
        internalGetMutableDevices().getMutableMap()
            .putAll(values);
        return this;
      }

      private java.util.List<tensorflow.tpu.TraceEvents.TraceEvent> traceEvents_ =
        java.util.Collections.emptyList();
      private void ensureTraceEventsIsMutable() {
        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
          traceEvents_ = new java.util.ArrayList<tensorflow.tpu.TraceEvents.TraceEvent>(traceEvents_);
          bitField0_ |= 0x00000002;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
          tensorflow.tpu.TraceEvents.TraceEvent, tensorflow.tpu.TraceEvents.TraceEvent.Builder, tensorflow.tpu.TraceEvents.TraceEventOrBuilder> traceEventsBuilder_;

      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public java.util.List<tensorflow.tpu.TraceEvents.TraceEvent> getTraceEventsList() {
        if (traceEventsBuilder_ == null) {
          return java.util.Collections.unmodifiableList(traceEvents_);
        } else {
          return traceEventsBuilder_.getMessageList();
        }
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public int getTraceEventsCount() {
        if (traceEventsBuilder_ == null) {
          return traceEvents_.size();
        } else {
          return traceEventsBuilder_.getCount();
        }
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public tensorflow.tpu.TraceEvents.TraceEvent getTraceEvents(int index) {
        if (traceEventsBuilder_ == null) {
          return traceEvents_.get(index);
        } else {
          return traceEventsBuilder_.getMessage(index);
        }
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public Builder setTraceEvents(
          int index, tensorflow.tpu.TraceEvents.TraceEvent value) {
        if (traceEventsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTraceEventsIsMutable();
          traceEvents_.set(index, value);
          onChanged();
        } else {
          traceEventsBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public Builder setTraceEvents(
          int index, tensorflow.tpu.TraceEvents.TraceEvent.Builder builderForValue) {
        if (traceEventsBuilder_ == null) {
          ensureTraceEventsIsMutable();
          traceEvents_.set(index, builderForValue.build());
          onChanged();
        } else {
          traceEventsBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public Builder addTraceEvents(tensorflow.tpu.TraceEvents.TraceEvent value) {
        if (traceEventsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTraceEventsIsMutable();
          traceEvents_.add(value);
          onChanged();
        } else {
          traceEventsBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public Builder addTraceEvents(
          int index, tensorflow.tpu.TraceEvents.TraceEvent value) {
        if (traceEventsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTraceEventsIsMutable();
          traceEvents_.add(index, value);
          onChanged();
        } else {
          traceEventsBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public Builder addTraceEvents(
          tensorflow.tpu.TraceEvents.TraceEvent.Builder builderForValue) {
        if (traceEventsBuilder_ == null) {
          ensureTraceEventsIsMutable();
          traceEvents_.add(builderForValue.build());
          onChanged();
        } else {
          traceEventsBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public Builder addTraceEvents(
          int index, tensorflow.tpu.TraceEvents.TraceEvent.Builder builderForValue) {
        if (traceEventsBuilder_ == null) {
          ensureTraceEventsIsMutable();
          traceEvents_.add(index, builderForValue.build());
          onChanged();
        } else {
          traceEventsBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public Builder addAllTraceEvents(
          java.lang.Iterable<? extends tensorflow.tpu.TraceEvents.TraceEvent> values) {
        if (traceEventsBuilder_ == null) {
          ensureTraceEventsIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(
              values, traceEvents_);
          onChanged();
        } else {
          traceEventsBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public Builder clearTraceEvents() {
        if (traceEventsBuilder_ == null) {
          traceEvents_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000002);
          onChanged();
        } else {
          traceEventsBuilder_.clear();
        }
        return this;
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public Builder removeTraceEvents(int index) {
        if (traceEventsBuilder_ == null) {
          ensureTraceEventsIsMutable();
          traceEvents_.remove(index);
          onChanged();
        } else {
          traceEventsBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public tensorflow.tpu.TraceEvents.TraceEvent.Builder getTraceEventsBuilder(
          int index) {
        return getTraceEventsFieldBuilder().getBuilder(index);
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public tensorflow.tpu.TraceEvents.TraceEventOrBuilder getTraceEventsOrBuilder(
          int index) {
        if (traceEventsBuilder_ == null) {
          return traceEvents_.get(index);  } else {
          return traceEventsBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public java.util.List<? extends tensorflow.tpu.TraceEvents.TraceEventOrBuilder> 
           getTraceEventsOrBuilderList() {
        if (traceEventsBuilder_ != null) {
          return traceEventsBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(traceEvents_);
        }
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public tensorflow.tpu.TraceEvents.TraceEvent.Builder addTraceEventsBuilder() {
        return getTraceEventsFieldBuilder().addBuilder(
            tensorflow.tpu.TraceEvents.TraceEvent.getDefaultInstance());
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public tensorflow.tpu.TraceEvents.TraceEvent.Builder addTraceEventsBuilder(
          int index) {
        return getTraceEventsFieldBuilder().addBuilder(
            index, tensorflow.tpu.TraceEvents.TraceEvent.getDefaultInstance());
      }
      /**
       * <pre>
       * All trace events capturing in the profiling period.
       * </pre>
       *
       * <code>repeated .tensorflow.tpu.TraceEvent trace_events = 4;</code>
       */
      public java.util.List<tensorflow.tpu.TraceEvents.TraceEvent.Builder> 
           getTraceEventsBuilderList() {
        return getTraceEventsFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilderV3<
          tensorflow.tpu.TraceEvents.TraceEvent, tensorflow.tpu.TraceEvents.TraceEvent.Builder, tensorflow.tpu.TraceEvents.TraceEventOrBuilder> 
          getTraceEventsFieldBuilder() {
        if (traceEventsBuilder_ == null) {
          traceEventsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
              tensorflow.tpu.TraceEvents.TraceEvent, tensorflow.tpu.TraceEvents.TraceEvent.Builder, tensorflow.tpu.TraceEvents.TraceEventOrBuilder>(
                  traceEvents_,
                  ((bitField0_ & 0x00000002) == 0x00000002),
                  getParentForChildren(),
                  isClean());
          traceEvents_ = null;
        }
        return traceEventsBuilder_;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }

      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }


      // @@protoc_insertion_point(builder_scope:tensorflow.tpu.Trace)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.tpu.Trace)
    private static final tensorflow.tpu.TraceEvents.Trace DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new tensorflow.tpu.TraceEvents.Trace();
    }

    public static tensorflow.tpu.TraceEvents.Trace getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    public tensorflow.tpu.TraceEvents.Trace getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface DeviceOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.tpu.Device)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * The name of the device.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    java.lang.String getName();
    /**
     * <pre>
     * The name of the device.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    com.google.protobuf.ByteString
        getNameBytes();

    /**
     * <pre>
     * The id of this device, unique in a single trace.
     * </pre>
     *
     * <code>uint32 device_id = 2;</code>
     */
    int getDeviceId();

    /**
     * <pre>
     * The resources on this device, keyed by resource_id;
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
     */
    int getResourcesCount();
    /**
     * <pre>
     * The resources on this device, keyed by resource_id;
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
     */
    boolean containsResources(
        int key);
    /**
     * Use {@link #getResourcesMap()} instead.
     */
    @java.lang.Deprecated
    java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource>
    getResources();
    /**
     * <pre>
     * The resources on this device, keyed by resource_id;
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
     */
    java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource>
    getResourcesMap();
    /**
     * <pre>
     * The resources on this device, keyed by resource_id;
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
     */

    tensorflow.tpu.TraceEvents.Resource getResourcesOrDefault(
        int key,
        tensorflow.tpu.TraceEvents.Resource defaultValue);
    /**
     * <pre>
     * The resources on this device, keyed by resource_id;
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
     */

    tensorflow.tpu.TraceEvents.Resource getResourcesOrThrow(
        int key);
  }
  /**
   * <pre>
   * A 'device' is a physical entity in the system and is comprised of several
   * resources.
   * </pre>
   *
   * Protobuf type {@code tensorflow.tpu.Device}
   */
  public  static final class Device extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.tpu.Device)
      DeviceOrBuilder {
    // Use Device.newBuilder() to construct.
    private Device(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private Device() {
      name_ = "";
      deviceId_ = 0;
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
    }
    private Device(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      int mutable_bitField0_ = 0;
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!input.skipField(tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
            case 16: {

              deviceId_ = input.readUInt32();
              break;
            }
            case 26: {
              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
                resources_ = com.google.protobuf.MapField.newMapField(
                    ResourcesDefaultEntryHolder.defaultEntry);
                mutable_bitField0_ |= 0x00000004;
              }
              com.google.protobuf.MapEntry<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource>
              resources__ = input.readMessage(
                  ResourcesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
              resources_.getMutableMap().put(
                  resources__.getKey(), resources__.getValue());
              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 {
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Device_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 3:
          return internalGetResources();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Device_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              tensorflow.tpu.TraceEvents.Device.class, tensorflow.tpu.TraceEvents.Device.Builder.class);
    }

    private int bitField0_;
    public static final int NAME_FIELD_NUMBER = 1;
    private volatile java.lang.Object name_;
    /**
     * <pre>
     * The name of the device.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      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();
        name_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The name of the device.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public com.google.protobuf.ByteString
        getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int DEVICE_ID_FIELD_NUMBER = 2;
    private int deviceId_;
    /**
     * <pre>
     * The id of this device, unique in a single trace.
     * </pre>
     *
     * <code>uint32 device_id = 2;</code>
     */
    public int getDeviceId() {
      return deviceId_;
    }

    public static final int RESOURCES_FIELD_NUMBER = 3;
    private static final class ResourcesDefaultEntryHolder {
      static final com.google.protobuf.MapEntry<
          java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> defaultEntry =
              com.google.protobuf.MapEntry
              .<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource>newDefaultInstance(
                  tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Device_ResourcesEntry_descriptor, 
                  com.google.protobuf.WireFormat.FieldType.UINT32,
                  0,
                  com.google.protobuf.WireFormat.FieldType.MESSAGE,
                  tensorflow.tpu.TraceEvents.Resource.getDefaultInstance());
    }
    private com.google.protobuf.MapField<
        java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> resources_;
    private com.google.protobuf.MapField<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource>
    internalGetResources() {
      if (resources_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            ResourcesDefaultEntryHolder.defaultEntry);
      }
      return resources_;
    }

    public int getResourcesCount() {
      return internalGetResources().getMap().size();
    }
    /**
     * <pre>
     * The resources on this device, keyed by resource_id;
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
     */

    public boolean containsResources(
        int key) {
      
      return internalGetResources().getMap().containsKey(key);
    }
    /**
     * Use {@link #getResourcesMap()} instead.
     */
    @java.lang.Deprecated
    public java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> getResources() {
      return getResourcesMap();
    }
    /**
     * <pre>
     * The resources on this device, keyed by resource_id;
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
     */

    public java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> getResourcesMap() {
      return internalGetResources().getMap();
    }
    /**
     * <pre>
     * The resources on this device, keyed by resource_id;
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
     */

    public tensorflow.tpu.TraceEvents.Resource getResourcesOrDefault(
        int key,
        tensorflow.tpu.TraceEvents.Resource defaultValue) {
      
      java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> map =
          internalGetResources().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * <pre>
     * The resources on this device, keyed by resource_id;
     * </pre>
     *
     * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
     */

    public tensorflow.tpu.TraceEvents.Resource getResourcesOrThrow(
        int key) {
      
      java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> map =
          internalGetResources().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!getNameBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
      }
      if (deviceId_ != 0) {
        output.writeUInt32(2, deviceId_);
      }
      com.google.protobuf.GeneratedMessageV3
        .serializeIntegerMapTo(
          output,
          internalGetResources(),
          ResourcesDefaultEntryHolder.defaultEntry,
          3);
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!getNameBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
      }
      if (deviceId_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeUInt32Size(2, deviceId_);
      }
      for (java.util.Map.Entry<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> entry
           : internalGetResources().getMap().entrySet()) {
        com.google.protobuf.MapEntry<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource>
        resources__ = ResourcesDefaultEntryHolder.defaultEntry.newBuilderForType()
            .setKey(entry.getKey())
            .setValue(entry.getValue())
            .build();
        size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(3, resources__);
      }
      memoizedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof tensorflow.tpu.TraceEvents.Device)) {
        return super.equals(obj);
      }
      tensorflow.tpu.TraceEvents.Device other = (tensorflow.tpu.TraceEvents.Device) obj;

      boolean result = true;
      result = result && getName()
          .equals(other.getName());
      result = result && (getDeviceId()
          == other.getDeviceId());
      result = result && internalGetResources().equals(
          other.internalGetResources());
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + NAME_FIELD_NUMBER;
      hash = (53 * hash) + getName().hashCode();
      hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceId();
      if (!internalGetResources().getMap().isEmpty()) {
        hash = (37 * hash) + RESOURCES_FIELD_NUMBER;
        hash = (53 * hash) + internalGetResources().hashCode();
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

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

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(tensorflow.tpu.TraceEvents.Device prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * <pre>
     * A 'device' is a physical entity in the system and is comprised of several
     * resources.
     * </pre>
     *
     * Protobuf type {@code tensorflow.tpu.Device}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.tpu.Device)
        tensorflow.tpu.TraceEvents.DeviceOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Device_descriptor;
      }

      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMapField(
          int number) {
        switch (number) {
          case 3:
            return internalGetResources();
          default:
            throw new RuntimeException(
                "Invalid map field number: " + number);
        }
      }
      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMutableMapField(
          int number) {
        switch (number) {
          case 3:
            return internalGetMutableResources();
          default:
            throw new RuntimeException(
                "Invalid map field number: " + number);
        }
      }
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Device_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                tensorflow.tpu.TraceEvents.Device.class, tensorflow.tpu.TraceEvents.Device.Builder.class);
      }

      // Construct using tensorflow.tpu.TraceEvents.Device.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      public Builder clear() {
        super.clear();
        name_ = "";

        deviceId_ = 0;

        internalGetMutableResources().clear();
        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Device_descriptor;
      }

      public tensorflow.tpu.TraceEvents.Device getDefaultInstanceForType() {
        return tensorflow.tpu.TraceEvents.Device.getDefaultInstance();
      }

      public tensorflow.tpu.TraceEvents.Device build() {
        tensorflow.tpu.TraceEvents.Device result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public tensorflow.tpu.TraceEvents.Device buildPartial() {
        tensorflow.tpu.TraceEvents.Device result = new tensorflow.tpu.TraceEvents.Device(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        result.name_ = name_;
        result.deviceId_ = deviceId_;
        result.resources_ = internalGetResources();
        result.resources_.makeImmutable();
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof tensorflow.tpu.TraceEvents.Device) {
          return mergeFrom((tensorflow.tpu.TraceEvents.Device)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(tensorflow.tpu.TraceEvents.Device other) {
        if (other == tensorflow.tpu.TraceEvents.Device.getDefaultInstance()) return this;
        if (!other.getName().isEmpty()) {
          name_ = other.name_;
          onChanged();
        }
        if (other.getDeviceId() != 0) {
          setDeviceId(other.getDeviceId());
        }
        internalGetMutableResources().mergeFrom(
            other.internalGetResources());
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        tensorflow.tpu.TraceEvents.Device parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (tensorflow.tpu.TraceEvents.Device) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      private java.lang.Object name_ = "";
      /**
       * <pre>
       * The name of the device.
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public java.lang.String getName() {
        java.lang.Object ref = name_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          name_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The name of the device.
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public com.google.protobuf.ByteString
          getNameBytes() {
        java.lang.Object ref = name_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          name_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The name of the device.
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public Builder setName(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        name_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The name of the device.
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public Builder clearName() {
        
        name_ = getDefaultInstance().getName();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The name of the device.
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public Builder setNameBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        name_ = value;
        onChanged();
        return this;
      }

      private int deviceId_ ;
      /**
       * <pre>
       * The id of this device, unique in a single trace.
       * </pre>
       *
       * <code>uint32 device_id = 2;</code>
       */
      public int getDeviceId() {
        return deviceId_;
      }
      /**
       * <pre>
       * The id of this device, unique in a single trace.
       * </pre>
       *
       * <code>uint32 device_id = 2;</code>
       */
      public Builder setDeviceId(int value) {
        
        deviceId_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The id of this device, unique in a single trace.
       * </pre>
       *
       * <code>uint32 device_id = 2;</code>
       */
      public Builder clearDeviceId() {
        
        deviceId_ = 0;
        onChanged();
        return this;
      }

      private com.google.protobuf.MapField<
          java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> resources_;
      private com.google.protobuf.MapField<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource>
      internalGetResources() {
        if (resources_ == null) {
          return com.google.protobuf.MapField.emptyMapField(
              ResourcesDefaultEntryHolder.defaultEntry);
        }
        return resources_;
      }
      private com.google.protobuf.MapField<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource>
      internalGetMutableResources() {
        onChanged();;
        if (resources_ == null) {
          resources_ = com.google.protobuf.MapField.newMapField(
              ResourcesDefaultEntryHolder.defaultEntry);
        }
        if (!resources_.isMutable()) {
          resources_ = resources_.copy();
        }
        return resources_;
      }

      public int getResourcesCount() {
        return internalGetResources().getMap().size();
      }
      /**
       * <pre>
       * The resources on this device, keyed by resource_id;
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
       */

      public boolean containsResources(
          int key) {
        
        return internalGetResources().getMap().containsKey(key);
      }
      /**
       * Use {@link #getResourcesMap()} instead.
       */
      @java.lang.Deprecated
      public java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> getResources() {
        return getResourcesMap();
      }
      /**
       * <pre>
       * The resources on this device, keyed by resource_id;
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
       */

      public java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> getResourcesMap() {
        return internalGetResources().getMap();
      }
      /**
       * <pre>
       * The resources on this device, keyed by resource_id;
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
       */

      public tensorflow.tpu.TraceEvents.Resource getResourcesOrDefault(
          int key,
          tensorflow.tpu.TraceEvents.Resource defaultValue) {
        
        java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> map =
            internalGetResources().getMap();
        return map.containsKey(key) ? map.get(key) : defaultValue;
      }
      /**
       * <pre>
       * The resources on this device, keyed by resource_id;
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
       */

      public tensorflow.tpu.TraceEvents.Resource getResourcesOrThrow(
          int key) {
        
        java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> map =
            internalGetResources().getMap();
        if (!map.containsKey(key)) {
          throw new java.lang.IllegalArgumentException();
        }
        return map.get(key);
      }

      public Builder clearResources() {
        internalGetMutableResources().getMutableMap()
            .clear();
        return this;
      }
      /**
       * <pre>
       * The resources on this device, keyed by resource_id;
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
       */

      public Builder removeResources(
          int key) {
        
        internalGetMutableResources().getMutableMap()
            .remove(key);
        return this;
      }
      /**
       * Use alternate mutation accessors instead.
       */
      @java.lang.Deprecated
      public java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource>
      getMutableResources() {
        return internalGetMutableResources().getMutableMap();
      }
      /**
       * <pre>
       * The resources on this device, keyed by resource_id;
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
       */
      public Builder putResources(
          int key,
          tensorflow.tpu.TraceEvents.Resource value) {
        
        if (value == null) { throw new java.lang.NullPointerException(); }
        internalGetMutableResources().getMutableMap()
            .put(key, value);
        return this;
      }
      /**
       * <pre>
       * The resources on this device, keyed by resource_id;
       * </pre>
       *
       * <code>map&lt;uint32, .tensorflow.tpu.Resource&gt; resources = 3;</code>
       */

      public Builder putAllResources(
          java.util.Map<java.lang.Integer, tensorflow.tpu.TraceEvents.Resource> values) {
        internalGetMutableResources().getMutableMap()
            .putAll(values);
        return this;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }

      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }


      // @@protoc_insertion_point(builder_scope:tensorflow.tpu.Device)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.tpu.Device)
    private static final tensorflow.tpu.TraceEvents.Device DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new tensorflow.tpu.TraceEvents.Device();
    }

    public static tensorflow.tpu.TraceEvents.Device getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    public tensorflow.tpu.TraceEvents.Device getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface ResourceOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.tpu.Resource)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * The name of the resource.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    java.lang.String getName();
    /**
     * <pre>
     * The name of the resource.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    com.google.protobuf.ByteString
        getNameBytes();

    /**
     * <pre>
     * The id of the resource. Unique within a device.
     * </pre>
     *
     * <code>uint32 resource_id = 2;</code>
     */
    int getResourceId();
  }
  /**
   * <pre>
   * A 'resource' generally is a specific computation component on a device. These
   * can range from threads on CPUs to specific arithmetic units on hardware
   * devices.
   * </pre>
   *
   * Protobuf type {@code tensorflow.tpu.Resource}
   */
  public  static final class Resource extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.tpu.Resource)
      ResourceOrBuilder {
    // Use Resource.newBuilder() to construct.
    private Resource(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private Resource() {
      name_ = "";
      resourceId_ = 0;
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
    }
    private Resource(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      int mutable_bitField0_ = 0;
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!input.skipField(tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
            case 16: {

              resourceId_ = input.readUInt32();
              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 {
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Resource_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Resource_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              tensorflow.tpu.TraceEvents.Resource.class, tensorflow.tpu.TraceEvents.Resource.Builder.class);
    }

    public static final int NAME_FIELD_NUMBER = 1;
    private volatile java.lang.Object name_;
    /**
     * <pre>
     * The name of the resource.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      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();
        name_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The name of the resource.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public com.google.protobuf.ByteString
        getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int RESOURCE_ID_FIELD_NUMBER = 2;
    private int resourceId_;
    /**
     * <pre>
     * The id of the resource. Unique within a device.
     * </pre>
     *
     * <code>uint32 resource_id = 2;</code>
     */
    public int getResourceId() {
      return resourceId_;
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!getNameBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
      }
      if (resourceId_ != 0) {
        output.writeUInt32(2, resourceId_);
      }
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (!getNameBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
      }
      if (resourceId_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeUInt32Size(2, resourceId_);
      }
      memoizedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof tensorflow.tpu.TraceEvents.Resource)) {
        return super.equals(obj);
      }
      tensorflow.tpu.TraceEvents.Resource other = (tensorflow.tpu.TraceEvents.Resource) obj;

      boolean result = true;
      result = result && getName()
          .equals(other.getName());
      result = result && (getResourceId()
          == other.getResourceId());
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + NAME_FIELD_NUMBER;
      hash = (53 * hash) + getName().hashCode();
      hash = (37 * hash) + RESOURCE_ID_FIELD_NUMBER;
      hash = (53 * hash) + getResourceId();
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

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

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(tensorflow.tpu.TraceEvents.Resource prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * <pre>
     * A 'resource' generally is a specific computation component on a device. These
     * can range from threads on CPUs to specific arithmetic units on hardware
     * devices.
     * </pre>
     *
     * Protobuf type {@code tensorflow.tpu.Resource}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.tpu.Resource)
        tensorflow.tpu.TraceEvents.ResourceOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Resource_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Resource_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                tensorflow.tpu.TraceEvents.Resource.class, tensorflow.tpu.TraceEvents.Resource.Builder.class);
      }

      // Construct using tensorflow.tpu.TraceEvents.Resource.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      public Builder clear() {
        super.clear();
        name_ = "";

        resourceId_ = 0;

        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_Resource_descriptor;
      }

      public tensorflow.tpu.TraceEvents.Resource getDefaultInstanceForType() {
        return tensorflow.tpu.TraceEvents.Resource.getDefaultInstance();
      }

      public tensorflow.tpu.TraceEvents.Resource build() {
        tensorflow.tpu.TraceEvents.Resource result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public tensorflow.tpu.TraceEvents.Resource buildPartial() {
        tensorflow.tpu.TraceEvents.Resource result = new tensorflow.tpu.TraceEvents.Resource(this);
        result.name_ = name_;
        result.resourceId_ = resourceId_;
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof tensorflow.tpu.TraceEvents.Resource) {
          return mergeFrom((tensorflow.tpu.TraceEvents.Resource)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(tensorflow.tpu.TraceEvents.Resource other) {
        if (other == tensorflow.tpu.TraceEvents.Resource.getDefaultInstance()) return this;
        if (!other.getName().isEmpty()) {
          name_ = other.name_;
          onChanged();
        }
        if (other.getResourceId() != 0) {
          setResourceId(other.getResourceId());
        }
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        tensorflow.tpu.TraceEvents.Resource parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (tensorflow.tpu.TraceEvents.Resource) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private java.lang.Object name_ = "";
      /**
       * <pre>
       * The name of the resource.
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public java.lang.String getName() {
        java.lang.Object ref = name_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          name_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The name of the resource.
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public com.google.protobuf.ByteString
          getNameBytes() {
        java.lang.Object ref = name_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          name_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The name of the resource.
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public Builder setName(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        name_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The name of the resource.
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public Builder clearName() {
        
        name_ = getDefaultInstance().getName();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The name of the resource.
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public Builder setNameBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        name_ = value;
        onChanged();
        return this;
      }

      private int resourceId_ ;
      /**
       * <pre>
       * The id of the resource. Unique within a device.
       * </pre>
       *
       * <code>uint32 resource_id = 2;</code>
       */
      public int getResourceId() {
        return resourceId_;
      }
      /**
       * <pre>
       * The id of the resource. Unique within a device.
       * </pre>
       *
       * <code>uint32 resource_id = 2;</code>
       */
      public Builder setResourceId(int value) {
        
        resourceId_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The id of the resource. Unique within a device.
       * </pre>
       *
       * <code>uint32 resource_id = 2;</code>
       */
      public Builder clearResourceId() {
        
        resourceId_ = 0;
        onChanged();
        return this;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }

      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }


      // @@protoc_insertion_point(builder_scope:tensorflow.tpu.Resource)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.tpu.Resource)
    private static final tensorflow.tpu.TraceEvents.Resource DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new tensorflow.tpu.TraceEvents.Resource();
    }

    public static tensorflow.tpu.TraceEvents.Resource getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    public tensorflow.tpu.TraceEvents.Resource getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface TraceEventOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.tpu.TraceEvent)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * The id of the device that this event occurred on. The full dataset should
     * have this device present in the Trace object.
     * </pre>
     *
     * <code>uint32 device_id = 1;</code>
     */
    int getDeviceId();

    /**
     * <pre>
     * The id of the resource that this event occurred on. The full dataset should
     * have this resource present in the Device object of the Trace object. A
     * resource_id is unique on a specific device, but not necessarily within the
     * trace.
     * </pre>
     *
     * <code>uint32 resource_id = 2;</code>
     */
    int getResourceId();

    /**
     * <pre>
     * The name of this trace event.
     * </pre>
     *
     * <code>string name = 3;</code>
     */
    java.lang.String getName();
    /**
     * <pre>
     * The name of this trace event.
     * </pre>
     *
     * <code>string name = 3;</code>
     */
    com.google.protobuf.ByteString
        getNameBytes();

    /**
     * <pre>
     * The timestamp that this event occurred at (in picos since tracing started).
     * </pre>
     *
     * <code>uint64 timestamp_ps = 9;</code>
     */
    long getTimestampPs();

    /**
     * <pre>
     * The duration of the event in picoseconds if applicable.
     * Events without duration are called instant events.
     * </pre>
     *
     * <code>uint64 duration_ps = 10;</code>
     */
    long getDurationPs();
  }
  /**
   * Protobuf type {@code tensorflow.tpu.TraceEvent}
   */
  public  static final class TraceEvent extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.tpu.TraceEvent)
      TraceEventOrBuilder {
    // Use TraceEvent.newBuilder() to construct.
    private TraceEvent(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private TraceEvent() {
      deviceId_ = 0;
      resourceId_ = 0;
      name_ = "";
      timestampPs_ = 0L;
      durationPs_ = 0L;
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
    }
    private TraceEvent(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      int mutable_bitField0_ = 0;
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!input.skipField(tag)) {
                done = true;
              }
              break;
            }
            case 8: {

              deviceId_ = input.readUInt32();
              break;
            }
            case 16: {

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

              name_ = s;
              break;
            }
            case 72: {

              timestampPs_ = input.readUInt64();
              break;
            }
            case 80: {

              durationPs_ = input.readUInt64();
              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 {
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_TraceEvent_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_TraceEvent_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              tensorflow.tpu.TraceEvents.TraceEvent.class, tensorflow.tpu.TraceEvents.TraceEvent.Builder.class);
    }

    public static final int DEVICE_ID_FIELD_NUMBER = 1;
    private int deviceId_;
    /**
     * <pre>
     * The id of the device that this event occurred on. The full dataset should
     * have this device present in the Trace object.
     * </pre>
     *
     * <code>uint32 device_id = 1;</code>
     */
    public int getDeviceId() {
      return deviceId_;
    }

    public static final int RESOURCE_ID_FIELD_NUMBER = 2;
    private int resourceId_;
    /**
     * <pre>
     * The id of the resource that this event occurred on. The full dataset should
     * have this resource present in the Device object of the Trace object. A
     * resource_id is unique on a specific device, but not necessarily within the
     * trace.
     * </pre>
     *
     * <code>uint32 resource_id = 2;</code>
     */
    public int getResourceId() {
      return resourceId_;
    }

    public static final int NAME_FIELD_NUMBER = 3;
    private volatile java.lang.Object name_;
    /**
     * <pre>
     * The name of this trace event.
     * </pre>
     *
     * <code>string name = 3;</code>
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      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();
        name_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The name of this trace event.
     * </pre>
     *
     * <code>string name = 3;</code>
     */
    public com.google.protobuf.ByteString
        getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int TIMESTAMP_PS_FIELD_NUMBER = 9;
    private long timestampPs_;
    /**
     * <pre>
     * The timestamp that this event occurred at (in picos since tracing started).
     * </pre>
     *
     * <code>uint64 timestamp_ps = 9;</code>
     */
    public long getTimestampPs() {
      return timestampPs_;
    }

    public static final int DURATION_PS_FIELD_NUMBER = 10;
    private long durationPs_;
    /**
     * <pre>
     * The duration of the event in picoseconds if applicable.
     * Events without duration are called instant events.
     * </pre>
     *
     * <code>uint64 duration_ps = 10;</code>
     */
    public long getDurationPs() {
      return durationPs_;
    }

    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (deviceId_ != 0) {
        output.writeUInt32(1, deviceId_);
      }
      if (resourceId_ != 0) {
        output.writeUInt32(2, resourceId_);
      }
      if (!getNameBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_);
      }
      if (timestampPs_ != 0L) {
        output.writeUInt64(9, timestampPs_);
      }
      if (durationPs_ != 0L) {
        output.writeUInt64(10, durationPs_);
      }
    }

    public int getSerializedSize() {
      int size = memoizedSize;
      if (size != -1) return size;

      size = 0;
      if (deviceId_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeUInt32Size(1, deviceId_);
      }
      if (resourceId_ != 0) {
        size += com.google.protobuf.CodedOutputStream
          .computeUInt32Size(2, resourceId_);
      }
      if (!getNameBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_);
      }
      if (timestampPs_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeUInt64Size(9, timestampPs_);
      }
      if (durationPs_ != 0L) {
        size += com.google.protobuf.CodedOutputStream
          .computeUInt64Size(10, durationPs_);
      }
      memoizedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    public boolean equals(final java.lang.Object obj) {
      if (obj == this) {
       return true;
      }
      if (!(obj instanceof tensorflow.tpu.TraceEvents.TraceEvent)) {
        return super.equals(obj);
      }
      tensorflow.tpu.TraceEvents.TraceEvent other = (tensorflow.tpu.TraceEvents.TraceEvent) obj;

      boolean result = true;
      result = result && (getDeviceId()
          == other.getDeviceId());
      result = result && (getResourceId()
          == other.getResourceId());
      result = result && getName()
          .equals(other.getName());
      result = result && (getTimestampPs()
          == other.getTimestampPs());
      result = result && (getDurationPs()
          == other.getDurationPs());
      return result;
    }

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      hash = (37 * hash) + DEVICE_ID_FIELD_NUMBER;
      hash = (53 * hash) + getDeviceId();
      hash = (37 * hash) + RESOURCE_ID_FIELD_NUMBER;
      hash = (53 * hash) + getResourceId();
      hash = (37 * hash) + NAME_FIELD_NUMBER;
      hash = (53 * hash) + getName().hashCode();
      hash = (37 * hash) + TIMESTAMP_PS_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getTimestampPs());
      hash = (37 * hash) + DURATION_PS_FIELD_NUMBER;
      hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
          getDurationPs());
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

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

    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(tensorflow.tpu.TraceEvents.TraceEvent prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    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.tpu.TraceEvent}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.tpu.TraceEvent)
        tensorflow.tpu.TraceEvents.TraceEventOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_TraceEvent_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_TraceEvent_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                tensorflow.tpu.TraceEvents.TraceEvent.class, tensorflow.tpu.TraceEvents.TraceEvent.Builder.class);
      }

      // Construct using tensorflow.tpu.TraceEvents.TraceEvent.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
        }
      }
      public Builder clear() {
        super.clear();
        deviceId_ = 0;

        resourceId_ = 0;

        name_ = "";

        timestampPs_ = 0L;

        durationPs_ = 0L;

        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return tensorflow.tpu.TraceEvents.internal_static_tensorflow_tpu_TraceEvent_descriptor;
      }

      public tensorflow.tpu.TraceEvents.TraceEvent getDefaultInstanceForType() {
        return tensorflow.tpu.TraceEvents.TraceEvent.getDefaultInstance();
      }

      public tensorflow.tpu.TraceEvents.TraceEvent build() {
        tensorflow.tpu.TraceEvents.TraceEvent result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public tensorflow.tpu.TraceEvents.TraceEvent buildPartial() {
        tensorflow.tpu.TraceEvents.TraceEvent result = new tensorflow.tpu.TraceEvents.TraceEvent(this);
        result.deviceId_ = deviceId_;
        result.resourceId_ = resourceId_;
        result.name_ = name_;
        result.timestampPs_ = timestampPs_;
        result.durationPs_ = durationPs_;
        onBuilt();
        return result;
      }

      public Builder clone() {
        return (Builder) super.clone();
      }
      public Builder setField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.setField(field, value);
      }
      public Builder clearField(
          com.google.protobuf.Descriptors.FieldDescriptor field) {
        return (Builder) super.clearField(field);
      }
      public Builder clearOneof(
          com.google.protobuf.Descriptors.OneofDescriptor oneof) {
        return (Builder) super.clearOneof(oneof);
      }
      public Builder setRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          int index, Object value) {
        return (Builder) super.setRepeatedField(field, index, value);
      }
      public Builder addRepeatedField(
          com.google.protobuf.Descriptors.FieldDescriptor field,
          Object value) {
        return (Builder) super.addRepeatedField(field, value);
      }
      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof tensorflow.tpu.TraceEvents.TraceEvent) {
          return mergeFrom((tensorflow.tpu.TraceEvents.TraceEvent)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(tensorflow.tpu.TraceEvents.TraceEvent other) {
        if (other == tensorflow.tpu.TraceEvents.TraceEvent.getDefaultInstance()) return this;
        if (other.getDeviceId() != 0) {
          setDeviceId(other.getDeviceId());
        }
        if (other.getResourceId() != 0) {
          setResourceId(other.getResourceId());
        }
        if (!other.getName().isEmpty()) {
          name_ = other.name_;
          onChanged();
        }
        if (other.getTimestampPs() != 0L) {
          setTimestampPs(other.getTimestampPs());
        }
        if (other.getDurationPs() != 0L) {
          setDurationPs(other.getDurationPs());
        }
        onChanged();
        return this;
      }

      public final boolean isInitialized() {
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        tensorflow.tpu.TraceEvents.TraceEvent parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (tensorflow.tpu.TraceEvents.TraceEvent) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private int deviceId_ ;
      /**
       * <pre>
       * The id of the device that this event occurred on. The full dataset should
       * have this device present in the Trace object.
       * </pre>
       *
       * <code>uint32 device_id = 1;</code>
       */
      public int getDeviceId() {
        return deviceId_;
      }
      /**
       * <pre>
       * The id of the device that this event occurred on. The full dataset should
       * have this device present in the Trace object.
       * </pre>
       *
       * <code>uint32 device_id = 1;</code>
       */
      public Builder setDeviceId(int value) {
        
        deviceId_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The id of the device that this event occurred on. The full dataset should
       * have this device present in the Trace object.
       * </pre>
       *
       * <code>uint32 device_id = 1;</code>
       */
      public Builder clearDeviceId() {
        
        deviceId_ = 0;
        onChanged();
        return this;
      }

      private int resourceId_ ;
      /**
       * <pre>
       * The id of the resource that this event occurred on. The full dataset should
       * have this resource present in the Device object of the Trace object. A
       * resource_id is unique on a specific device, but not necessarily within the
       * trace.
       * </pre>
       *
       * <code>uint32 resource_id = 2;</code>
       */
      public int getResourceId() {
        return resourceId_;
      }
      /**
       * <pre>
       * The id of the resource that this event occurred on. The full dataset should
       * have this resource present in the Device object of the Trace object. A
       * resource_id is unique on a specific device, but not necessarily within the
       * trace.
       * </pre>
       *
       * <code>uint32 resource_id = 2;</code>
       */
      public Builder setResourceId(int value) {
        
        resourceId_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The id of the resource that this event occurred on. The full dataset should
       * have this resource present in the Device object of the Trace object. A
       * resource_id is unique on a specific device, but not necessarily within the
       * trace.
       * </pre>
       *
       * <code>uint32 resource_id = 2;</code>
       */
      public Builder clearResourceId() {
        
        resourceId_ = 0;
        onChanged();
        return this;
      }

      private java.lang.Object name_ = "";
      /**
       * <pre>
       * The name of this trace event.
       * </pre>
       *
       * <code>string name = 3;</code>
       */
      public java.lang.String getName() {
        java.lang.Object ref = name_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          name_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The name of this trace event.
       * </pre>
       *
       * <code>string name = 3;</code>
       */
      public com.google.protobuf.ByteString
          getNameBytes() {
        java.lang.Object ref = name_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          name_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The name of this trace event.
       * </pre>
       *
       * <code>string name = 3;</code>
       */
      public Builder setName(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        name_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The name of this trace event.
       * </pre>
       *
       * <code>string name = 3;</code>
       */
      public Builder clearName() {
        
        name_ = getDefaultInstance().getName();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The name of this trace event.
       * </pre>
       *
       * <code>string name = 3;</code>
       */
      public Builder setNameBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        name_ = value;
        onChanged();
        return this;
      }

      private long timestampPs_ ;
      /**
       * <pre>
       * The timestamp that this event occurred at (in picos since tracing started).
       * </pre>
       *
       * <code>uint64 timestamp_ps = 9;</code>
       */
      public long getTimestampPs() {
        return timestampPs_;
      }
      /**
       * <pre>
       * The timestamp that this event occurred at (in picos since tracing started).
       * </pre>
       *
       * <code>uint64 timestamp_ps = 9;</code>
       */
      public Builder setTimestampPs(long value) {
        
        timestampPs_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The timestamp that this event occurred at (in picos since tracing started).
       * </pre>
       *
       * <code>uint64 timestamp_ps = 9;</code>
       */
      public Builder clearTimestampPs() {
        
        timestampPs_ = 0L;
        onChanged();
        return this;
      }

      private long durationPs_ ;
      /**
       * <pre>
       * The duration of the event in picoseconds if applicable.
       * Events without duration are called instant events.
       * </pre>
       *
       * <code>uint64 duration_ps = 10;</code>
       */
      public long getDurationPs() {
        return durationPs_;
      }
      /**
       * <pre>
       * The duration of the event in picoseconds if applicable.
       * Events without duration are called instant events.
       * </pre>
       *
       * <code>uint64 duration_ps = 10;</code>
       */
      public Builder setDurationPs(long value) {
        
        durationPs_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The duration of the event in picoseconds if applicable.
       * Events without duration are called instant events.
       * </pre>
       *
       * <code>uint64 duration_ps = 10;</code>
       */
      public Builder clearDurationPs() {
        
        durationPs_ = 0L;
        onChanged();
        return this;
      }
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }

      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return this;
      }


      // @@protoc_insertion_point(builder_scope:tensorflow.tpu.TraceEvent)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.tpu.TraceEvent)
    private static final tensorflow.tpu.TraceEvents.TraceEvent DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new tensorflow.tpu.TraceEvents.TraceEvent();
    }

    public static tensorflow.tpu.TraceEvents.TraceEvent getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    public tensorflow.tpu.TraceEvents.TraceEvent getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_tpu_Trace_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_tpu_Trace_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_tpu_Trace_DevicesEntry_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_tpu_Trace_DevicesEntry_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_tpu_Device_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_tpu_Device_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_tpu_Device_ResourcesEntry_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_tpu_Device_ResourcesEntry_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_tpu_Resource_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_tpu_Resource_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_tpu_TraceEvent_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_tpu_TraceEvent_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n2tensorflow/contrib/tpu/profiler/trace_" +
      "events.proto\022\016tensorflow.tpu\"\266\001\n\005Trace\0223" +
      "\n\007devices\030\001 \003(\0132\".tensorflow.tpu.Trace.D" +
      "evicesEntry\0220\n\014trace_events\030\004 \003(\0132\032.tens" +
      "orflow.tpu.TraceEvent\032F\n\014DevicesEntry\022\013\n" +
      "\003key\030\001 \001(\r\022%\n\005value\030\002 \001(\0132\026.tensorflow.t" +
      "pu.Device:\0028\001\"\257\001\n\006Device\022\014\n\004name\030\001 \001(\t\022\021" +
      "\n\tdevice_id\030\002 \001(\r\0228\n\tresources\030\003 \003(\0132%.t" +
      "ensorflow.tpu.Device.ResourcesEntry\032J\n\016R" +
      "esourcesEntry\022\013\n\003key\030\001 \001(\r\022\'\n\005value\030\002 \001(",
      "\0132\030.tensorflow.tpu.Resource:\0028\001\"-\n\010Resou" +
      "rce\022\014\n\004name\030\001 \001(\t\022\023\n\013resource_id\030\002 \001(\r\"m" +
      "\n\nTraceEvent\022\021\n\tdevice_id\030\001 \001(\r\022\023\n\013resou" +
      "rce_id\030\002 \001(\r\022\014\n\004name\030\003 \001(\t\022\024\n\014timestamp_" +
      "ps\030\t \001(\004\022\023\n\013duration_ps\030\n \001(\004b\006proto3"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
        new com.google.protobuf.Descriptors.FileDescriptor.    InternalDescriptorAssigner() {
          public com.google.protobuf.ExtensionRegistry assignDescriptors(
              com.google.protobuf.Descriptors.FileDescriptor root) {
            descriptor = root;
            return null;
          }
        };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
        }, assigner);
    internal_static_tensorflow_tpu_Trace_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_tensorflow_tpu_Trace_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_tpu_Trace_descriptor,
        new java.lang.String[] { "Devices", "TraceEvents", });
    internal_static_tensorflow_tpu_Trace_DevicesEntry_descriptor =
      internal_static_tensorflow_tpu_Trace_descriptor.getNestedTypes().get(0);
    internal_static_tensorflow_tpu_Trace_DevicesEntry_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_tpu_Trace_DevicesEntry_descriptor,
        new java.lang.String[] { "Key", "Value", });
    internal_static_tensorflow_tpu_Device_descriptor =
      getDescriptor().getMessageTypes().get(1);
    internal_static_tensorflow_tpu_Device_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_tpu_Device_descriptor,
        new java.lang.String[] { "Name", "DeviceId", "Resources", });
    internal_static_tensorflow_tpu_Device_ResourcesEntry_descriptor =
      internal_static_tensorflow_tpu_Device_descriptor.getNestedTypes().get(0);
    internal_static_tensorflow_tpu_Device_ResourcesEntry_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_tpu_Device_ResourcesEntry_descriptor,
        new java.lang.String[] { "Key", "Value", });
    internal_static_tensorflow_tpu_Resource_descriptor =
      getDescriptor().getMessageTypes().get(2);
    internal_static_tensorflow_tpu_Resource_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_tpu_Resource_descriptor,
        new java.lang.String[] { "Name", "ResourceId", });
    internal_static_tensorflow_tpu_TraceEvent_descriptor =
      getDescriptor().getMessageTypes().get(3);
    internal_static_tensorflow_tpu_TraceEvent_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_tpu_TraceEvent_descriptor,
        new java.lang.String[] { "DeviceId", "ResourceId", "Name", "TimestampPs", "DurationPs", });
  }

  // @@protoc_insertion_point(outer_class_scope)
}
