// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: tensorflow_serving/resources/resources.proto

package tensorflow.serving;

public final class Resources {
  private Resources() {}
  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 ResourceOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.serving.Resource)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * The type of device on which the resource resides, e.g. CPU or GPU.
     * </pre>
     *
     * <code>string device = 1;</code>
     */
    java.lang.String getDevice();
    /**
     * <pre>
     * The type of device on which the resource resides, e.g. CPU or GPU.
     * </pre>
     *
     * <code>string device = 1;</code>
     */
    com.google.protobuf.ByteString
        getDeviceBytes();

    /**
     * <pre>
     * A specific instance of the device of type 'device' to which the resources
     * are bound (instances are assumed to be numbered 0, 1, ...).
     * When representing the resources required by a servable that has yet to be
     * loaded, this field is optional. If not set, it denotes that the servable's
     * resources are not (yet) bound to a specific instance.
     * </pre>
     *
     * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
     */
    boolean hasDeviceInstance();
    /**
     * <pre>
     * A specific instance of the device of type 'device' to which the resources
     * are bound (instances are assumed to be numbered 0, 1, ...).
     * When representing the resources required by a servable that has yet to be
     * loaded, this field is optional. If not set, it denotes that the servable's
     * resources are not (yet) bound to a specific instance.
     * </pre>
     *
     * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
     */
    com.google.protobuf.UInt32Value getDeviceInstance();
    /**
     * <pre>
     * A specific instance of the device of type 'device' to which the resources
     * are bound (instances are assumed to be numbered 0, 1, ...).
     * When representing the resources required by a servable that has yet to be
     * loaded, this field is optional. If not set, it denotes that the servable's
     * resources are not (yet) bound to a specific instance.
     * </pre>
     *
     * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
     */
    com.google.protobuf.UInt32ValueOrBuilder getDeviceInstanceOrBuilder();

    /**
     * <pre>
     * The kind of resource on the device (instance), e.g. RAM or compute share.
     * A given type of resource should have a standard unit that represents the
     * smallest useful quantization. We strongly recommend including the unit
     * (e.g. bytes or millicores) in this string, as in "ram_bytes".
     * </pre>
     *
     * <code>string kind = 3;</code>
     */
    java.lang.String getKind();
    /**
     * <pre>
     * The kind of resource on the device (instance), e.g. RAM or compute share.
     * A given type of resource should have a standard unit that represents the
     * smallest useful quantization. We strongly recommend including the unit
     * (e.g. bytes or millicores) in this string, as in "ram_bytes".
     * </pre>
     *
     * <code>string kind = 3;</code>
     */
    com.google.protobuf.ByteString
        getKindBytes();
  }
  /**
   * <pre>
   * One kind of resource on one device (or type of device).
   * </pre>
   *
   * Protobuf type {@code tensorflow.serving.Resource}
   */
  public  static final class Resource extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.serving.Resource)
      ResourceOrBuilder {
    // Use Resource.newBuilder() to construct.
    private Resource(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private Resource() {
      device_ = "";
      kind_ = "";
    }

    @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();

              device_ = s;
              break;
            }
            case 18: {
              com.google.protobuf.UInt32Value.Builder subBuilder = null;
              if (deviceInstance_ != null) {
                subBuilder = deviceInstance_.toBuilder();
              }
              deviceInstance_ = input.readMessage(com.google.protobuf.UInt32Value.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(deviceInstance_);
                deviceInstance_ = subBuilder.buildPartial();
              }

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

              kind_ = s;
              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.serving.Resources.internal_static_tensorflow_serving_Resource_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return tensorflow.serving.Resources.internal_static_tensorflow_serving_Resource_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              tensorflow.serving.Resources.Resource.class, tensorflow.serving.Resources.Resource.Builder.class);
    }

    public static final int DEVICE_FIELD_NUMBER = 1;
    private volatile java.lang.Object device_;
    /**
     * <pre>
     * The type of device on which the resource resides, e.g. CPU or GPU.
     * </pre>
     *
     * <code>string device = 1;</code>
     */
    public java.lang.String getDevice() {
      java.lang.Object ref = device_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        device_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The type of device on which the resource resides, e.g. CPU or GPU.
     * </pre>
     *
     * <code>string device = 1;</code>
     */
    public com.google.protobuf.ByteString
        getDeviceBytes() {
      java.lang.Object ref = device_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        device_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int DEVICE_INSTANCE_FIELD_NUMBER = 2;
    private com.google.protobuf.UInt32Value deviceInstance_;
    /**
     * <pre>
     * A specific instance of the device of type 'device' to which the resources
     * are bound (instances are assumed to be numbered 0, 1, ...).
     * When representing the resources required by a servable that has yet to be
     * loaded, this field is optional. If not set, it denotes that the servable's
     * resources are not (yet) bound to a specific instance.
     * </pre>
     *
     * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
     */
    public boolean hasDeviceInstance() {
      return deviceInstance_ != null;
    }
    /**
     * <pre>
     * A specific instance of the device of type 'device' to which the resources
     * are bound (instances are assumed to be numbered 0, 1, ...).
     * When representing the resources required by a servable that has yet to be
     * loaded, this field is optional. If not set, it denotes that the servable's
     * resources are not (yet) bound to a specific instance.
     * </pre>
     *
     * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
     */
    public com.google.protobuf.UInt32Value getDeviceInstance() {
      return deviceInstance_ == null ? com.google.protobuf.UInt32Value.getDefaultInstance() : deviceInstance_;
    }
    /**
     * <pre>
     * A specific instance of the device of type 'device' to which the resources
     * are bound (instances are assumed to be numbered 0, 1, ...).
     * When representing the resources required by a servable that has yet to be
     * loaded, this field is optional. If not set, it denotes that the servable's
     * resources are not (yet) bound to a specific instance.
     * </pre>
     *
     * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
     */
    public com.google.protobuf.UInt32ValueOrBuilder getDeviceInstanceOrBuilder() {
      return getDeviceInstance();
    }

    public static final int KIND_FIELD_NUMBER = 3;
    private volatile java.lang.Object kind_;
    /**
     * <pre>
     * The kind of resource on the device (instance), e.g. RAM or compute share.
     * A given type of resource should have a standard unit that represents the
     * smallest useful quantization. We strongly recommend including the unit
     * (e.g. bytes or millicores) in this string, as in "ram_bytes".
     * </pre>
     *
     * <code>string kind = 3;</code>
     */
    public java.lang.String getKind() {
      java.lang.Object ref = kind_;
      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();
        kind_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * The kind of resource on the device (instance), e.g. RAM or compute share.
     * A given type of resource should have a standard unit that represents the
     * smallest useful quantization. We strongly recommend including the unit
     * (e.g. bytes or millicores) in this string, as in "ram_bytes".
     * </pre>
     *
     * <code>string kind = 3;</code>
     */
    public com.google.protobuf.ByteString
        getKindBytes() {
      java.lang.Object ref = kind_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        kind_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    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 (!getDeviceBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, device_);
      }
      if (deviceInstance_ != null) {
        output.writeMessage(2, getDeviceInstance());
      }
      if (!getKindBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 3, kind_);
      }
    }

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

      size = 0;
      if (!getDeviceBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, device_);
      }
      if (deviceInstance_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, getDeviceInstance());
      }
      if (!getKindBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, kind_);
      }
      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.serving.Resources.Resource)) {
        return super.equals(obj);
      }
      tensorflow.serving.Resources.Resource other = (tensorflow.serving.Resources.Resource) obj;

      boolean result = true;
      result = result && getDevice()
          .equals(other.getDevice());
      result = result && (hasDeviceInstance() == other.hasDeviceInstance());
      if (hasDeviceInstance()) {
        result = result && getDeviceInstance()
            .equals(other.getDeviceInstance());
      }
      result = result && getKind()
          .equals(other.getKind());
      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_FIELD_NUMBER;
      hash = (53 * hash) + getDevice().hashCode();
      if (hasDeviceInstance()) {
        hash = (37 * hash) + DEVICE_INSTANCE_FIELD_NUMBER;
        hash = (53 * hash) + getDeviceInstance().hashCode();
      }
      hash = (37 * hash) + KIND_FIELD_NUMBER;
      hash = (53 * hash) + getKind().hashCode();
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static tensorflow.serving.Resources.Resource parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.serving.Resources.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.serving.Resources.Resource parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.serving.Resources.Resource parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.serving.Resources.Resource parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.serving.Resources.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.serving.Resources.Resource parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static tensorflow.serving.Resources.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.serving.Resources.Resource parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.serving.Resources.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.serving.Resources.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>
     * One kind of resource on one device (or type of device).
     * </pre>
     *
     * Protobuf type {@code tensorflow.serving.Resource}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.serving.Resource)
        tensorflow.serving.Resources.ResourceOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return tensorflow.serving.Resources.internal_static_tensorflow_serving_Resource_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return tensorflow.serving.Resources.internal_static_tensorflow_serving_Resource_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                tensorflow.serving.Resources.Resource.class, tensorflow.serving.Resources.Resource.Builder.class);
      }

      // Construct using tensorflow.serving.Resources.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();
        device_ = "";

        if (deviceInstanceBuilder_ == null) {
          deviceInstance_ = null;
        } else {
          deviceInstance_ = null;
          deviceInstanceBuilder_ = null;
        }
        kind_ = "";

        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return tensorflow.serving.Resources.internal_static_tensorflow_serving_Resource_descriptor;
      }

      public tensorflow.serving.Resources.Resource getDefaultInstanceForType() {
        return tensorflow.serving.Resources.Resource.getDefaultInstance();
      }

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

      public tensorflow.serving.Resources.Resource buildPartial() {
        tensorflow.serving.Resources.Resource result = new tensorflow.serving.Resources.Resource(this);
        result.device_ = device_;
        if (deviceInstanceBuilder_ == null) {
          result.deviceInstance_ = deviceInstance_;
        } else {
          result.deviceInstance_ = deviceInstanceBuilder_.build();
        }
        result.kind_ = kind_;
        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.serving.Resources.Resource) {
          return mergeFrom((tensorflow.serving.Resources.Resource)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(tensorflow.serving.Resources.Resource other) {
        if (other == tensorflow.serving.Resources.Resource.getDefaultInstance()) return this;
        if (!other.getDevice().isEmpty()) {
          device_ = other.device_;
          onChanged();
        }
        if (other.hasDeviceInstance()) {
          mergeDeviceInstance(other.getDeviceInstance());
        }
        if (!other.getKind().isEmpty()) {
          kind_ = other.kind_;
          onChanged();
        }
        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.serving.Resources.Resource parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (tensorflow.serving.Resources.Resource) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

      private java.lang.Object device_ = "";
      /**
       * <pre>
       * The type of device on which the resource resides, e.g. CPU or GPU.
       * </pre>
       *
       * <code>string device = 1;</code>
       */
      public java.lang.String getDevice() {
        java.lang.Object ref = device_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          device_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The type of device on which the resource resides, e.g. CPU or GPU.
       * </pre>
       *
       * <code>string device = 1;</code>
       */
      public com.google.protobuf.ByteString
          getDeviceBytes() {
        java.lang.Object ref = device_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          device_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The type of device on which the resource resides, e.g. CPU or GPU.
       * </pre>
       *
       * <code>string device = 1;</code>
       */
      public Builder setDevice(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        device_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The type of device on which the resource resides, e.g. CPU or GPU.
       * </pre>
       *
       * <code>string device = 1;</code>
       */
      public Builder clearDevice() {
        
        device_ = getDefaultInstance().getDevice();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The type of device on which the resource resides, e.g. CPU or GPU.
       * </pre>
       *
       * <code>string device = 1;</code>
       */
      public Builder setDeviceBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        device_ = value;
        onChanged();
        return this;
      }

      private com.google.protobuf.UInt32Value deviceInstance_ = null;
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder> deviceInstanceBuilder_;
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      public boolean hasDeviceInstance() {
        return deviceInstanceBuilder_ != null || deviceInstance_ != null;
      }
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      public com.google.protobuf.UInt32Value getDeviceInstance() {
        if (deviceInstanceBuilder_ == null) {
          return deviceInstance_ == null ? com.google.protobuf.UInt32Value.getDefaultInstance() : deviceInstance_;
        } else {
          return deviceInstanceBuilder_.getMessage();
        }
      }
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      public Builder setDeviceInstance(com.google.protobuf.UInt32Value value) {
        if (deviceInstanceBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          deviceInstance_ = value;
          onChanged();
        } else {
          deviceInstanceBuilder_.setMessage(value);
        }

        return this;
      }
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      public Builder setDeviceInstance(
          com.google.protobuf.UInt32Value.Builder builderForValue) {
        if (deviceInstanceBuilder_ == null) {
          deviceInstance_ = builderForValue.build();
          onChanged();
        } else {
          deviceInstanceBuilder_.setMessage(builderForValue.build());
        }

        return this;
      }
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      public Builder mergeDeviceInstance(com.google.protobuf.UInt32Value value) {
        if (deviceInstanceBuilder_ == null) {
          if (deviceInstance_ != null) {
            deviceInstance_ =
              com.google.protobuf.UInt32Value.newBuilder(deviceInstance_).mergeFrom(value).buildPartial();
          } else {
            deviceInstance_ = value;
          }
          onChanged();
        } else {
          deviceInstanceBuilder_.mergeFrom(value);
        }

        return this;
      }
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      public Builder clearDeviceInstance() {
        if (deviceInstanceBuilder_ == null) {
          deviceInstance_ = null;
          onChanged();
        } else {
          deviceInstance_ = null;
          deviceInstanceBuilder_ = null;
        }

        return this;
      }
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      public com.google.protobuf.UInt32Value.Builder getDeviceInstanceBuilder() {
        
        onChanged();
        return getDeviceInstanceFieldBuilder().getBuilder();
      }
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      public com.google.protobuf.UInt32ValueOrBuilder getDeviceInstanceOrBuilder() {
        if (deviceInstanceBuilder_ != null) {
          return deviceInstanceBuilder_.getMessageOrBuilder();
        } else {
          return deviceInstance_ == null ?
              com.google.protobuf.UInt32Value.getDefaultInstance() : deviceInstance_;
        }
      }
      /**
       * <pre>
       * A specific instance of the device of type 'device' to which the resources
       * are bound (instances are assumed to be numbered 0, 1, ...).
       * When representing the resources required by a servable that has yet to be
       * loaded, this field is optional. If not set, it denotes that the servable's
       * resources are not (yet) bound to a specific instance.
       * </pre>
       *
       * <code>.google.protobuf.UInt32Value device_instance = 2;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder> 
          getDeviceInstanceFieldBuilder() {
        if (deviceInstanceBuilder_ == null) {
          deviceInstanceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              com.google.protobuf.UInt32Value, com.google.protobuf.UInt32Value.Builder, com.google.protobuf.UInt32ValueOrBuilder>(
                  getDeviceInstance(),
                  getParentForChildren(),
                  isClean());
          deviceInstance_ = null;
        }
        return deviceInstanceBuilder_;
      }

      private java.lang.Object kind_ = "";
      /**
       * <pre>
       * The kind of resource on the device (instance), e.g. RAM or compute share.
       * A given type of resource should have a standard unit that represents the
       * smallest useful quantization. We strongly recommend including the unit
       * (e.g. bytes or millicores) in this string, as in "ram_bytes".
       * </pre>
       *
       * <code>string kind = 3;</code>
       */
      public java.lang.String getKind() {
        java.lang.Object ref = kind_;
        if (!(ref instanceof java.lang.String)) {
          com.google.protobuf.ByteString bs =
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          kind_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <pre>
       * The kind of resource on the device (instance), e.g. RAM or compute share.
       * A given type of resource should have a standard unit that represents the
       * smallest useful quantization. We strongly recommend including the unit
       * (e.g. bytes or millicores) in this string, as in "ram_bytes".
       * </pre>
       *
       * <code>string kind = 3;</code>
       */
      public com.google.protobuf.ByteString
          getKindBytes() {
        java.lang.Object ref = kind_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          kind_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <pre>
       * The kind of resource on the device (instance), e.g. RAM or compute share.
       * A given type of resource should have a standard unit that represents the
       * smallest useful quantization. We strongly recommend including the unit
       * (e.g. bytes or millicores) in this string, as in "ram_bytes".
       * </pre>
       *
       * <code>string kind = 3;</code>
       */
      public Builder setKind(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  
        kind_ = value;
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The kind of resource on the device (instance), e.g. RAM or compute share.
       * A given type of resource should have a standard unit that represents the
       * smallest useful quantization. We strongly recommend including the unit
       * (e.g. bytes or millicores) in this string, as in "ram_bytes".
       * </pre>
       *
       * <code>string kind = 3;</code>
       */
      public Builder clearKind() {
        
        kind_ = getDefaultInstance().getKind();
        onChanged();
        return this;
      }
      /**
       * <pre>
       * The kind of resource on the device (instance), e.g. RAM or compute share.
       * A given type of resource should have a standard unit that represents the
       * smallest useful quantization. We strongly recommend including the unit
       * (e.g. bytes or millicores) in this string, as in "ram_bytes".
       * </pre>
       *
       * <code>string kind = 3;</code>
       */
      public Builder setKindBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
        
        kind_ = value;
        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.serving.Resource)
    }

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

    public static tensorflow.serving.Resources.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.serving.Resources.Resource getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  public interface ResourceAllocationOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.serving.ResourceAllocation)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
     */
    java.util.List<tensorflow.serving.Resources.ResourceAllocation.Entry> 
        getResourceQuantitiesList();
    /**
     * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
     */
    tensorflow.serving.Resources.ResourceAllocation.Entry getResourceQuantities(int index);
    /**
     * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
     */
    int getResourceQuantitiesCount();
    /**
     * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
     */
    java.util.List<? extends tensorflow.serving.Resources.ResourceAllocation.EntryOrBuilder> 
        getResourceQuantitiesOrBuilderList();
    /**
     * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
     */
    tensorflow.serving.Resources.ResourceAllocation.EntryOrBuilder getResourceQuantitiesOrBuilder(
        int index);
  }
  /**
   * <pre>
   * An allocation of one or more kinds of resources, along with the quantity of
   * each. Used to denote the resources that a servable (or collection of
   * servables) will use or is currently using. Also used to denote resources
   * available to the serving system for loading more servables.
   * </pre>
   *
   * Protobuf type {@code tensorflow.serving.ResourceAllocation}
   */
  public  static final class ResourceAllocation extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.serving.ResourceAllocation)
      ResourceAllocationOrBuilder {
    // Use ResourceAllocation.newBuilder() to construct.
    private ResourceAllocation(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private ResourceAllocation() {
      resourceQuantities_ = java.util.Collections.emptyList();
    }

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
    }
    private ResourceAllocation(
        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)) {
                resourceQuantities_ = new java.util.ArrayList<tensorflow.serving.Resources.ResourceAllocation.Entry>();
                mutable_bitField0_ |= 0x00000001;
              }
              resourceQuantities_.add(
                  input.readMessage(tensorflow.serving.Resources.ResourceAllocation.Entry.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_ & 0x00000001) == 0x00000001)) {
          resourceQuantities_ = java.util.Collections.unmodifiableList(resourceQuantities_);
        }
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return tensorflow.serving.Resources.internal_static_tensorflow_serving_ResourceAllocation_descriptor;
    }

    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return tensorflow.serving.Resources.internal_static_tensorflow_serving_ResourceAllocation_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              tensorflow.serving.Resources.ResourceAllocation.class, tensorflow.serving.Resources.ResourceAllocation.Builder.class);
    }

    public interface EntryOrBuilder extends
        // @@protoc_insertion_point(interface_extends:tensorflow.serving.ResourceAllocation.Entry)
        com.google.protobuf.MessageOrBuilder {

      /**
       * <code>.tensorflow.serving.Resource resource = 1;</code>
       */
      boolean hasResource();
      /**
       * <code>.tensorflow.serving.Resource resource = 1;</code>
       */
      tensorflow.serving.Resources.Resource getResource();
      /**
       * <code>.tensorflow.serving.Resource resource = 1;</code>
       */
      tensorflow.serving.Resources.ResourceOrBuilder getResourceOrBuilder();

      /**
       * <code>uint64 quantity = 2;</code>
       */
      long getQuantity();
    }
    /**
     * <pre>
     * A collection of resources, each with a quantity. Treated as a resource-&gt;
     * quantity map, i.e. no resource can repeat and the order is immaterial.
     * </pre>
     *
     * Protobuf type {@code tensorflow.serving.ResourceAllocation.Entry}
     */
    public  static final class Entry extends
        com.google.protobuf.GeneratedMessageV3 implements
        // @@protoc_insertion_point(message_implements:tensorflow.serving.ResourceAllocation.Entry)
        EntryOrBuilder {
      // Use Entry.newBuilder() to construct.
      private Entry(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
        super(builder);
      }
      private Entry() {
        quantity_ = 0L;
      }

      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet
      getUnknownFields() {
        return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
      }
      private Entry(
          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: {
                tensorflow.serving.Resources.Resource.Builder subBuilder = null;
                if (resource_ != null) {
                  subBuilder = resource_.toBuilder();
                }
                resource_ = input.readMessage(tensorflow.serving.Resources.Resource.parser(), extensionRegistry);
                if (subBuilder != null) {
                  subBuilder.mergeFrom(resource_);
                  resource_ = subBuilder.buildPartial();
                }

                break;
              }
              case 16: {

                quantity_ = 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.serving.Resources.internal_static_tensorflow_serving_ResourceAllocation_Entry_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return tensorflow.serving.Resources.internal_static_tensorflow_serving_ResourceAllocation_Entry_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                tensorflow.serving.Resources.ResourceAllocation.Entry.class, tensorflow.serving.Resources.ResourceAllocation.Entry.Builder.class);
      }

      public static final int RESOURCE_FIELD_NUMBER = 1;
      private tensorflow.serving.Resources.Resource resource_;
      /**
       * <code>.tensorflow.serving.Resource resource = 1;</code>
       */
      public boolean hasResource() {
        return resource_ != null;
      }
      /**
       * <code>.tensorflow.serving.Resource resource = 1;</code>
       */
      public tensorflow.serving.Resources.Resource getResource() {
        return resource_ == null ? tensorflow.serving.Resources.Resource.getDefaultInstance() : resource_;
      }
      /**
       * <code>.tensorflow.serving.Resource resource = 1;</code>
       */
      public tensorflow.serving.Resources.ResourceOrBuilder getResourceOrBuilder() {
        return getResource();
      }

      public static final int QUANTITY_FIELD_NUMBER = 2;
      private long quantity_;
      /**
       * <code>uint64 quantity = 2;</code>
       */
      public long getQuantity() {
        return quantity_;
      }

      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 (resource_ != null) {
          output.writeMessage(1, getResource());
        }
        if (quantity_ != 0L) {
          output.writeUInt64(2, quantity_);
        }
      }

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

        size = 0;
        if (resource_ != null) {
          size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(1, getResource());
        }
        if (quantity_ != 0L) {
          size += com.google.protobuf.CodedOutputStream
            .computeUInt64Size(2, quantity_);
        }
        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.serving.Resources.ResourceAllocation.Entry)) {
          return super.equals(obj);
        }
        tensorflow.serving.Resources.ResourceAllocation.Entry other = (tensorflow.serving.Resources.ResourceAllocation.Entry) obj;

        boolean result = true;
        result = result && (hasResource() == other.hasResource());
        if (hasResource()) {
          result = result && getResource()
              .equals(other.getResource());
        }
        result = result && (getQuantity()
            == other.getQuantity());
        return result;
      }

      @java.lang.Override
      public int hashCode() {
        if (memoizedHashCode != 0) {
          return memoizedHashCode;
        }
        int hash = 41;
        hash = (19 * hash) + getDescriptor().hashCode();
        if (hasResource()) {
          hash = (37 * hash) + RESOURCE_FIELD_NUMBER;
          hash = (53 * hash) + getResource().hashCode();
        }
        hash = (37 * hash) + QUANTITY_FIELD_NUMBER;
        hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
            getQuantity());
        hash = (29 * hash) + unknownFields.hashCode();
        memoizedHashCode = hash;
        return hash;
      }

      public static tensorflow.serving.Resources.ResourceAllocation.Entry parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static tensorflow.serving.Resources.ResourceAllocation.Entry parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static tensorflow.serving.Resources.ResourceAllocation.Entry parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static tensorflow.serving.Resources.ResourceAllocation.Entry parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static tensorflow.serving.Resources.ResourceAllocation.Entry parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseWithIOException(PARSER, input);
      }
      public static tensorflow.serving.Resources.ResourceAllocation.Entry 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.serving.Resources.ResourceAllocation.Entry parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseDelimitedWithIOException(PARSER, input);
      }
      public static tensorflow.serving.Resources.ResourceAllocation.Entry 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.serving.Resources.ResourceAllocation.Entry parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseWithIOException(PARSER, input);
      }
      public static tensorflow.serving.Resources.ResourceAllocation.Entry 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.serving.Resources.ResourceAllocation.Entry 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 collection of resources, each with a quantity. Treated as a resource-&gt;
       * quantity map, i.e. no resource can repeat and the order is immaterial.
       * </pre>
       *
       * Protobuf type {@code tensorflow.serving.ResourceAllocation.Entry}
       */
      public static final class Builder extends
          com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
          // @@protoc_insertion_point(builder_implements:tensorflow.serving.ResourceAllocation.Entry)
          tensorflow.serving.Resources.ResourceAllocation.EntryOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor
            getDescriptor() {
          return tensorflow.serving.Resources.internal_static_tensorflow_serving_ResourceAllocation_Entry_descriptor;
        }

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return tensorflow.serving.Resources.internal_static_tensorflow_serving_ResourceAllocation_Entry_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  tensorflow.serving.Resources.ResourceAllocation.Entry.class, tensorflow.serving.Resources.ResourceAllocation.Entry.Builder.class);
        }

        // Construct using tensorflow.serving.Resources.ResourceAllocation.Entry.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();
          if (resourceBuilder_ == null) {
            resource_ = null;
          } else {
            resource_ = null;
            resourceBuilder_ = null;
          }
          quantity_ = 0L;

          return this;
        }

        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return tensorflow.serving.Resources.internal_static_tensorflow_serving_ResourceAllocation_Entry_descriptor;
        }

        public tensorflow.serving.Resources.ResourceAllocation.Entry getDefaultInstanceForType() {
          return tensorflow.serving.Resources.ResourceAllocation.Entry.getDefaultInstance();
        }

        public tensorflow.serving.Resources.ResourceAllocation.Entry build() {
          tensorflow.serving.Resources.ResourceAllocation.Entry result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }

        public tensorflow.serving.Resources.ResourceAllocation.Entry buildPartial() {
          tensorflow.serving.Resources.ResourceAllocation.Entry result = new tensorflow.serving.Resources.ResourceAllocation.Entry(this);
          if (resourceBuilder_ == null) {
            result.resource_ = resource_;
          } else {
            result.resource_ = resourceBuilder_.build();
          }
          result.quantity_ = quantity_;
          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.serving.Resources.ResourceAllocation.Entry) {
            return mergeFrom((tensorflow.serving.Resources.ResourceAllocation.Entry)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }

        public Builder mergeFrom(tensorflow.serving.Resources.ResourceAllocation.Entry other) {
          if (other == tensorflow.serving.Resources.ResourceAllocation.Entry.getDefaultInstance()) return this;
          if (other.hasResource()) {
            mergeResource(other.getResource());
          }
          if (other.getQuantity() != 0L) {
            setQuantity(other.getQuantity());
          }
          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.serving.Resources.ResourceAllocation.Entry parsedMessage = null;
          try {
            parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            parsedMessage = (tensorflow.serving.Resources.ResourceAllocation.Entry) e.getUnfinishedMessage();
            throw e.unwrapIOException();
          } finally {
            if (parsedMessage != null) {
              mergeFrom(parsedMessage);
            }
          }
          return this;
        }

        private tensorflow.serving.Resources.Resource resource_ = null;
        private com.google.protobuf.SingleFieldBuilderV3<
            tensorflow.serving.Resources.Resource, tensorflow.serving.Resources.Resource.Builder, tensorflow.serving.Resources.ResourceOrBuilder> resourceBuilder_;
        /**
         * <code>.tensorflow.serving.Resource resource = 1;</code>
         */
        public boolean hasResource() {
          return resourceBuilder_ != null || resource_ != null;
        }
        /**
         * <code>.tensorflow.serving.Resource resource = 1;</code>
         */
        public tensorflow.serving.Resources.Resource getResource() {
          if (resourceBuilder_ == null) {
            return resource_ == null ? tensorflow.serving.Resources.Resource.getDefaultInstance() : resource_;
          } else {
            return resourceBuilder_.getMessage();
          }
        }
        /**
         * <code>.tensorflow.serving.Resource resource = 1;</code>
         */
        public Builder setResource(tensorflow.serving.Resources.Resource value) {
          if (resourceBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            resource_ = value;
            onChanged();
          } else {
            resourceBuilder_.setMessage(value);
          }

          return this;
        }
        /**
         * <code>.tensorflow.serving.Resource resource = 1;</code>
         */
        public Builder setResource(
            tensorflow.serving.Resources.Resource.Builder builderForValue) {
          if (resourceBuilder_ == null) {
            resource_ = builderForValue.build();
            onChanged();
          } else {
            resourceBuilder_.setMessage(builderForValue.build());
          }

          return this;
        }
        /**
         * <code>.tensorflow.serving.Resource resource = 1;</code>
         */
        public Builder mergeResource(tensorflow.serving.Resources.Resource value) {
          if (resourceBuilder_ == null) {
            if (resource_ != null) {
              resource_ =
                tensorflow.serving.Resources.Resource.newBuilder(resource_).mergeFrom(value).buildPartial();
            } else {
              resource_ = value;
            }
            onChanged();
          } else {
            resourceBuilder_.mergeFrom(value);
          }

          return this;
        }
        /**
         * <code>.tensorflow.serving.Resource resource = 1;</code>
         */
        public Builder clearResource() {
          if (resourceBuilder_ == null) {
            resource_ = null;
            onChanged();
          } else {
            resource_ = null;
            resourceBuilder_ = null;
          }

          return this;
        }
        /**
         * <code>.tensorflow.serving.Resource resource = 1;</code>
         */
        public tensorflow.serving.Resources.Resource.Builder getResourceBuilder() {
          
          onChanged();
          return getResourceFieldBuilder().getBuilder();
        }
        /**
         * <code>.tensorflow.serving.Resource resource = 1;</code>
         */
        public tensorflow.serving.Resources.ResourceOrBuilder getResourceOrBuilder() {
          if (resourceBuilder_ != null) {
            return resourceBuilder_.getMessageOrBuilder();
          } else {
            return resource_ == null ?
                tensorflow.serving.Resources.Resource.getDefaultInstance() : resource_;
          }
        }
        /**
         * <code>.tensorflow.serving.Resource resource = 1;</code>
         */
        private com.google.protobuf.SingleFieldBuilderV3<
            tensorflow.serving.Resources.Resource, tensorflow.serving.Resources.Resource.Builder, tensorflow.serving.Resources.ResourceOrBuilder> 
            getResourceFieldBuilder() {
          if (resourceBuilder_ == null) {
            resourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
                tensorflow.serving.Resources.Resource, tensorflow.serving.Resources.Resource.Builder, tensorflow.serving.Resources.ResourceOrBuilder>(
                    getResource(),
                    getParentForChildren(),
                    isClean());
            resource_ = null;
          }
          return resourceBuilder_;
        }

        private long quantity_ ;
        /**
         * <code>uint64 quantity = 2;</code>
         */
        public long getQuantity() {
          return quantity_;
        }
        /**
         * <code>uint64 quantity = 2;</code>
         */
        public Builder setQuantity(long value) {
          
          quantity_ = value;
          onChanged();
          return this;
        }
        /**
         * <code>uint64 quantity = 2;</code>
         */
        public Builder clearQuantity() {
          
          quantity_ = 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.serving.ResourceAllocation.Entry)
      }

      // @@protoc_insertion_point(class_scope:tensorflow.serving.ResourceAllocation.Entry)
      private static final tensorflow.serving.Resources.ResourceAllocation.Entry DEFAULT_INSTANCE;
      static {
        DEFAULT_INSTANCE = new tensorflow.serving.Resources.ResourceAllocation.Entry();
      }

      public static tensorflow.serving.Resources.ResourceAllocation.Entry getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }

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

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

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

      public tensorflow.serving.Resources.ResourceAllocation.Entry getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }

    }

    public static final int RESOURCE_QUANTITIES_FIELD_NUMBER = 1;
    private java.util.List<tensorflow.serving.Resources.ResourceAllocation.Entry> resourceQuantities_;
    /**
     * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
     */
    public java.util.List<tensorflow.serving.Resources.ResourceAllocation.Entry> getResourceQuantitiesList() {
      return resourceQuantities_;
    }
    /**
     * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
     */
    public java.util.List<? extends tensorflow.serving.Resources.ResourceAllocation.EntryOrBuilder> 
        getResourceQuantitiesOrBuilderList() {
      return resourceQuantities_;
    }
    /**
     * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
     */
    public int getResourceQuantitiesCount() {
      return resourceQuantities_.size();
    }
    /**
     * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
     */
    public tensorflow.serving.Resources.ResourceAllocation.Entry getResourceQuantities(int index) {
      return resourceQuantities_.get(index);
    }
    /**
     * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
     */
    public tensorflow.serving.Resources.ResourceAllocation.EntryOrBuilder getResourceQuantitiesOrBuilder(
        int index) {
      return resourceQuantities_.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 {
      for (int i = 0; i < resourceQuantities_.size(); i++) {
        output.writeMessage(1, resourceQuantities_.get(i));
      }
    }

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

      size = 0;
      for (int i = 0; i < resourceQuantities_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(1, resourceQuantities_.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.serving.Resources.ResourceAllocation)) {
        return super.equals(obj);
      }
      tensorflow.serving.Resources.ResourceAllocation other = (tensorflow.serving.Resources.ResourceAllocation) obj;

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

    @java.lang.Override
    public int hashCode() {
      if (memoizedHashCode != 0) {
        return memoizedHashCode;
      }
      int hash = 41;
      hash = (19 * hash) + getDescriptor().hashCode();
      if (getResourceQuantitiesCount() > 0) {
        hash = (37 * hash) + RESOURCE_QUANTITIES_FIELD_NUMBER;
        hash = (53 * hash) + getResourceQuantitiesList().hashCode();
      }
      hash = (29 * hash) + unknownFields.hashCode();
      memoizedHashCode = hash;
      return hash;
    }

    public static tensorflow.serving.Resources.ResourceAllocation parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.serving.Resources.ResourceAllocation parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.serving.Resources.ResourceAllocation parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static tensorflow.serving.Resources.ResourceAllocation parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static tensorflow.serving.Resources.ResourceAllocation parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.serving.Resources.ResourceAllocation 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.serving.Resources.ResourceAllocation parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseDelimitedWithIOException(PARSER, input);
    }
    public static tensorflow.serving.Resources.ResourceAllocation 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.serving.Resources.ResourceAllocation parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return com.google.protobuf.GeneratedMessageV3
          .parseWithIOException(PARSER, input);
    }
    public static tensorflow.serving.Resources.ResourceAllocation 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.serving.Resources.ResourceAllocation 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>
     * An allocation of one or more kinds of resources, along with the quantity of
     * each. Used to denote the resources that a servable (or collection of
     * servables) will use or is currently using. Also used to denote resources
     * available to the serving system for loading more servables.
     * </pre>
     *
     * Protobuf type {@code tensorflow.serving.ResourceAllocation}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.serving.ResourceAllocation)
        tensorflow.serving.Resources.ResourceAllocationOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return tensorflow.serving.Resources.internal_static_tensorflow_serving_ResourceAllocation_descriptor;
      }

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return tensorflow.serving.Resources.internal_static_tensorflow_serving_ResourceAllocation_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                tensorflow.serving.Resources.ResourceAllocation.class, tensorflow.serving.Resources.ResourceAllocation.Builder.class);
      }

      // Construct using tensorflow.serving.Resources.ResourceAllocation.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessageV3
                .alwaysUseFieldBuilders) {
          getResourceQuantitiesFieldBuilder();
        }
      }
      public Builder clear() {
        super.clear();
        if (resourceQuantitiesBuilder_ == null) {
          resourceQuantities_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          resourceQuantitiesBuilder_.clear();
        }
        return this;
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return tensorflow.serving.Resources.internal_static_tensorflow_serving_ResourceAllocation_descriptor;
      }

      public tensorflow.serving.Resources.ResourceAllocation getDefaultInstanceForType() {
        return tensorflow.serving.Resources.ResourceAllocation.getDefaultInstance();
      }

      public tensorflow.serving.Resources.ResourceAllocation build() {
        tensorflow.serving.Resources.ResourceAllocation result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public tensorflow.serving.Resources.ResourceAllocation buildPartial() {
        tensorflow.serving.Resources.ResourceAllocation result = new tensorflow.serving.Resources.ResourceAllocation(this);
        int from_bitField0_ = bitField0_;
        if (resourceQuantitiesBuilder_ == null) {
          if (((bitField0_ & 0x00000001) == 0x00000001)) {
            resourceQuantities_ = java.util.Collections.unmodifiableList(resourceQuantities_);
            bitField0_ = (bitField0_ & ~0x00000001);
          }
          result.resourceQuantities_ = resourceQuantities_;
        } else {
          result.resourceQuantities_ = resourceQuantitiesBuilder_.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.serving.Resources.ResourceAllocation) {
          return mergeFrom((tensorflow.serving.Resources.ResourceAllocation)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(tensorflow.serving.Resources.ResourceAllocation other) {
        if (other == tensorflow.serving.Resources.ResourceAllocation.getDefaultInstance()) return this;
        if (resourceQuantitiesBuilder_ == null) {
          if (!other.resourceQuantities_.isEmpty()) {
            if (resourceQuantities_.isEmpty()) {
              resourceQuantities_ = other.resourceQuantities_;
              bitField0_ = (bitField0_ & ~0x00000001);
            } else {
              ensureResourceQuantitiesIsMutable();
              resourceQuantities_.addAll(other.resourceQuantities_);
            }
            onChanged();
          }
        } else {
          if (!other.resourceQuantities_.isEmpty()) {
            if (resourceQuantitiesBuilder_.isEmpty()) {
              resourceQuantitiesBuilder_.dispose();
              resourceQuantitiesBuilder_ = null;
              resourceQuantities_ = other.resourceQuantities_;
              bitField0_ = (bitField0_ & ~0x00000001);
              resourceQuantitiesBuilder_ = 
                com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                   getResourceQuantitiesFieldBuilder() : null;
            } else {
              resourceQuantitiesBuilder_.addAllMessages(other.resourceQuantities_);
            }
          }
        }
        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.serving.Resources.ResourceAllocation parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (tensorflow.serving.Resources.ResourceAllocation) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      private java.util.List<tensorflow.serving.Resources.ResourceAllocation.Entry> resourceQuantities_ =
        java.util.Collections.emptyList();
      private void ensureResourceQuantitiesIsMutable() {
        if (!((bitField0_ & 0x00000001) == 0x00000001)) {
          resourceQuantities_ = new java.util.ArrayList<tensorflow.serving.Resources.ResourceAllocation.Entry>(resourceQuantities_);
          bitField0_ |= 0x00000001;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilderV3<
          tensorflow.serving.Resources.ResourceAllocation.Entry, tensorflow.serving.Resources.ResourceAllocation.Entry.Builder, tensorflow.serving.Resources.ResourceAllocation.EntryOrBuilder> resourceQuantitiesBuilder_;

      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public java.util.List<tensorflow.serving.Resources.ResourceAllocation.Entry> getResourceQuantitiesList() {
        if (resourceQuantitiesBuilder_ == null) {
          return java.util.Collections.unmodifiableList(resourceQuantities_);
        } else {
          return resourceQuantitiesBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public int getResourceQuantitiesCount() {
        if (resourceQuantitiesBuilder_ == null) {
          return resourceQuantities_.size();
        } else {
          return resourceQuantitiesBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public tensorflow.serving.Resources.ResourceAllocation.Entry getResourceQuantities(int index) {
        if (resourceQuantitiesBuilder_ == null) {
          return resourceQuantities_.get(index);
        } else {
          return resourceQuantitiesBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public Builder setResourceQuantities(
          int index, tensorflow.serving.Resources.ResourceAllocation.Entry value) {
        if (resourceQuantitiesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureResourceQuantitiesIsMutable();
          resourceQuantities_.set(index, value);
          onChanged();
        } else {
          resourceQuantitiesBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public Builder setResourceQuantities(
          int index, tensorflow.serving.Resources.ResourceAllocation.Entry.Builder builderForValue) {
        if (resourceQuantitiesBuilder_ == null) {
          ensureResourceQuantitiesIsMutable();
          resourceQuantities_.set(index, builderForValue.build());
          onChanged();
        } else {
          resourceQuantitiesBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public Builder addResourceQuantities(tensorflow.serving.Resources.ResourceAllocation.Entry value) {
        if (resourceQuantitiesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureResourceQuantitiesIsMutable();
          resourceQuantities_.add(value);
          onChanged();
        } else {
          resourceQuantitiesBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public Builder addResourceQuantities(
          int index, tensorflow.serving.Resources.ResourceAllocation.Entry value) {
        if (resourceQuantitiesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureResourceQuantitiesIsMutable();
          resourceQuantities_.add(index, value);
          onChanged();
        } else {
          resourceQuantitiesBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public Builder addResourceQuantities(
          tensorflow.serving.Resources.ResourceAllocation.Entry.Builder builderForValue) {
        if (resourceQuantitiesBuilder_ == null) {
          ensureResourceQuantitiesIsMutable();
          resourceQuantities_.add(builderForValue.build());
          onChanged();
        } else {
          resourceQuantitiesBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public Builder addResourceQuantities(
          int index, tensorflow.serving.Resources.ResourceAllocation.Entry.Builder builderForValue) {
        if (resourceQuantitiesBuilder_ == null) {
          ensureResourceQuantitiesIsMutable();
          resourceQuantities_.add(index, builderForValue.build());
          onChanged();
        } else {
          resourceQuantitiesBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public Builder addAllResourceQuantities(
          java.lang.Iterable<? extends tensorflow.serving.Resources.ResourceAllocation.Entry> values) {
        if (resourceQuantitiesBuilder_ == null) {
          ensureResourceQuantitiesIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(
              values, resourceQuantities_);
          onChanged();
        } else {
          resourceQuantitiesBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public Builder clearResourceQuantities() {
        if (resourceQuantitiesBuilder_ == null) {
          resourceQuantities_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
        } else {
          resourceQuantitiesBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public Builder removeResourceQuantities(int index) {
        if (resourceQuantitiesBuilder_ == null) {
          ensureResourceQuantitiesIsMutable();
          resourceQuantities_.remove(index);
          onChanged();
        } else {
          resourceQuantitiesBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public tensorflow.serving.Resources.ResourceAllocation.Entry.Builder getResourceQuantitiesBuilder(
          int index) {
        return getResourceQuantitiesFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public tensorflow.serving.Resources.ResourceAllocation.EntryOrBuilder getResourceQuantitiesOrBuilder(
          int index) {
        if (resourceQuantitiesBuilder_ == null) {
          return resourceQuantities_.get(index);  } else {
          return resourceQuantitiesBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public java.util.List<? extends tensorflow.serving.Resources.ResourceAllocation.EntryOrBuilder> 
           getResourceQuantitiesOrBuilderList() {
        if (resourceQuantitiesBuilder_ != null) {
          return resourceQuantitiesBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(resourceQuantities_);
        }
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public tensorflow.serving.Resources.ResourceAllocation.Entry.Builder addResourceQuantitiesBuilder() {
        return getResourceQuantitiesFieldBuilder().addBuilder(
            tensorflow.serving.Resources.ResourceAllocation.Entry.getDefaultInstance());
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public tensorflow.serving.Resources.ResourceAllocation.Entry.Builder addResourceQuantitiesBuilder(
          int index) {
        return getResourceQuantitiesFieldBuilder().addBuilder(
            index, tensorflow.serving.Resources.ResourceAllocation.Entry.getDefaultInstance());
      }
      /**
       * <code>repeated .tensorflow.serving.ResourceAllocation.Entry resource_quantities = 1;</code>
       */
      public java.util.List<tensorflow.serving.Resources.ResourceAllocation.Entry.Builder> 
           getResourceQuantitiesBuilderList() {
        return getResourceQuantitiesFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilderV3<
          tensorflow.serving.Resources.ResourceAllocation.Entry, tensorflow.serving.Resources.ResourceAllocation.Entry.Builder, tensorflow.serving.Resources.ResourceAllocation.EntryOrBuilder> 
          getResourceQuantitiesFieldBuilder() {
        if (resourceQuantitiesBuilder_ == null) {
          resourceQuantitiesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
              tensorflow.serving.Resources.ResourceAllocation.Entry, tensorflow.serving.Resources.ResourceAllocation.Entry.Builder, tensorflow.serving.Resources.ResourceAllocation.EntryOrBuilder>(
                  resourceQuantities_,
                  ((bitField0_ & 0x00000001) == 0x00000001),
                  getParentForChildren(),
                  isClean());
          resourceQuantities_ = null;
        }
        return resourceQuantitiesBuilder_;
      }
      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.serving.ResourceAllocation)
    }

    // @@protoc_insertion_point(class_scope:tensorflow.serving.ResourceAllocation)
    private static final tensorflow.serving.Resources.ResourceAllocation DEFAULT_INSTANCE;
    static {
      DEFAULT_INSTANCE = new tensorflow.serving.Resources.ResourceAllocation();
    }

    public static tensorflow.serving.Resources.ResourceAllocation getDefaultInstance() {
      return DEFAULT_INSTANCE;
    }

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

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

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

    public tensorflow.serving.Resources.ResourceAllocation getDefaultInstanceForType() {
      return DEFAULT_INSTANCE;
    }

  }

  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_serving_Resource_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_serving_Resource_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_serving_ResourceAllocation_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_serving_ResourceAllocation_fieldAccessorTable;
  private static final com.google.protobuf.Descriptors.Descriptor
    internal_static_tensorflow_serving_ResourceAllocation_Entry_descriptor;
  private static final 
    com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internal_static_tensorflow_serving_ResourceAllocation_Entry_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static  com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n,tensorflow_serving/resources/resources" +
      ".proto\022\022tensorflow.serving\032\036google/proto" +
      "buf/wrappers.proto\"_\n\010Resource\022\016\n\006device" +
      "\030\001 \001(\t\0225\n\017device_instance\030\002 \001(\0132\034.google" +
      ".protobuf.UInt32Value\022\014\n\004kind\030\003 \001(\t\"\252\001\n\022" +
      "ResourceAllocation\022I\n\023resource_quantitie" +
      "s\030\001 \003(\0132,.tensorflow.serving.ResourceAll" +
      "ocation.Entry\032I\n\005Entry\022.\n\010resource\030\001 \001(\013" +
      "2\034.tensorflow.serving.Resource\022\020\n\010quanti" +
      "ty\030\002 \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[] {
          com.google.protobuf.WrappersProto.getDescriptor(),
        }, assigner);
    internal_static_tensorflow_serving_Resource_descriptor =
      getDescriptor().getMessageTypes().get(0);
    internal_static_tensorflow_serving_Resource_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_serving_Resource_descriptor,
        new java.lang.String[] { "Device", "DeviceInstance", "Kind", });
    internal_static_tensorflow_serving_ResourceAllocation_descriptor =
      getDescriptor().getMessageTypes().get(1);
    internal_static_tensorflow_serving_ResourceAllocation_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_serving_ResourceAllocation_descriptor,
        new java.lang.String[] { "ResourceQuantities", });
    internal_static_tensorflow_serving_ResourceAllocation_Entry_descriptor =
      internal_static_tensorflow_serving_ResourceAllocation_descriptor.getNestedTypes().get(0);
    internal_static_tensorflow_serving_ResourceAllocation_Entry_fieldAccessorTable = new
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
        internal_static_tensorflow_serving_ResourceAllocation_Entry_descriptor,
        new java.lang.String[] { "Resource", "Quantity", });
    com.google.protobuf.WrappersProto.getDescriptor();
  }

  // @@protoc_insertion_point(outer_class_scope)
}
