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

package org.tensorflow.proto.framework;

/**
 * Protobuf type {@code tensorflow.KernelDef}
 */
public  final class KernelDef extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:tensorflow.KernelDef)
    KernelDefOrBuilder {
private static final long serialVersionUID = 0L;
  // Use KernelDef.newBuilder() to construct.
  private KernelDef(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
    super(builder);
  }
  private KernelDef() {
    op_ = "";
    deviceType_ = "";
    constraint_ = java.util.Collections.emptyList();
    hostMemoryArg_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    label_ = "";
  }

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

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

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

            deviceType_ = s;
            break;
          }
          case 26: {
            if (!((mutable_bitField0_ & 0x00000001) != 0)) {
              constraint_ = new java.util.ArrayList<org.tensorflow.proto.framework.KernelDef.AttrConstraint>();
              mutable_bitField0_ |= 0x00000001;
            }
            constraint_.add(
                input.readMessage(org.tensorflow.proto.framework.KernelDef.AttrConstraint.parser(), extensionRegistry));
            break;
          }
          case 34: {
            java.lang.String s = input.readStringRequireUtf8();
            if (!((mutable_bitField0_ & 0x00000002) != 0)) {
              hostMemoryArg_ = new com.google.protobuf.LazyStringArrayList();
              mutable_bitField0_ |= 0x00000002;
            }
            hostMemoryArg_.add(s);
            break;
          }
          case 42: {
            java.lang.String s = input.readStringRequireUtf8();

            label_ = s;
            break;
          }
          case 48: {

            priority_ = input.readInt32();
            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        constraint_ = java.util.Collections.unmodifiableList(constraint_);
      }
      if (((mutable_bitField0_ & 0x00000002) != 0)) {
        hostMemoryArg_ = hostMemoryArg_.getUnmodifiableView();
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_descriptor;
  }

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

  public interface AttrConstraintOrBuilder extends
      // @@protoc_insertion_point(interface_extends:tensorflow.KernelDef.AttrConstraint)
      com.google.protobuf.MessageOrBuilder {

    /**
     * <pre>
     * Name of an attr from the Op.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    java.lang.String getName();
    /**
     * <pre>
     * Name of an attr from the Op.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    com.google.protobuf.ByteString
        getNameBytes();

    /**
     * <pre>
     * A list of values that this kernel supports for this attr.
     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
     * </pre>
     *
     * <code>.tensorflow.AttrValue allowed_values = 2;</code>
     */
    boolean hasAllowedValues();
    /**
     * <pre>
     * A list of values that this kernel supports for this attr.
     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
     * </pre>
     *
     * <code>.tensorflow.AttrValue allowed_values = 2;</code>
     */
    org.tensorflow.proto.framework.AttrValue getAllowedValues();
    /**
     * <pre>
     * A list of values that this kernel supports for this attr.
     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
     * </pre>
     *
     * <code>.tensorflow.AttrValue allowed_values = 2;</code>
     */
    org.tensorflow.proto.framework.AttrValueOrBuilder getAllowedValuesOrBuilder();
  }
  /**
   * Protobuf type {@code tensorflow.KernelDef.AttrConstraint}
   */
  public  static final class AttrConstraint extends
      com.google.protobuf.GeneratedMessageV3 implements
      // @@protoc_insertion_point(message_implements:tensorflow.KernelDef.AttrConstraint)
      AttrConstraintOrBuilder {
  private static final long serialVersionUID = 0L;
    // Use AttrConstraint.newBuilder() to construct.
    private AttrConstraint(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
      super(builder);
    }
    private AttrConstraint() {
      name_ = "";
    }

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

    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
    getUnknownFields() {
      return this.unknownFields;
    }
    private AttrConstraint(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      this();
      if (extensionRegistry == null) {
        throw new java.lang.NullPointerException();
      }
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            case 10: {
              java.lang.String s = input.readStringRequireUtf8();

              name_ = s;
              break;
            }
            case 18: {
              org.tensorflow.proto.framework.AttrValue.Builder subBuilder = null;
              if (allowedValues_ != null) {
                subBuilder = allowedValues_.toBuilder();
              }
              allowedValues_ = input.readMessage(org.tensorflow.proto.framework.AttrValue.parser(), extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(allowedValues_);
                allowedValues_ = subBuilder.buildPartial();
              }

              break;
            }
            default: {
              if (!parseUnknownField(
                  input, unknownFields, extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.tensorflow.proto.framework.KernelDef.AttrConstraint.class, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder.class);
    }

    public static final int NAME_FIELD_NUMBER = 1;
    private volatile java.lang.Object name_;
    /**
     * <pre>
     * Name of an attr from the Op.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      }
    }
    /**
     * <pre>
     * Name of an attr from the Op.
     * </pre>
     *
     * <code>string name = 1;</code>
     */
    public com.google.protobuf.ByteString
        getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    public static final int ALLOWED_VALUES_FIELD_NUMBER = 2;
    private org.tensorflow.proto.framework.AttrValue allowedValues_;
    /**
     * <pre>
     * A list of values that this kernel supports for this attr.
     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
     * </pre>
     *
     * <code>.tensorflow.AttrValue allowed_values = 2;</code>
     */
    public boolean hasAllowedValues() {
      return allowedValues_ != null;
    }
    /**
     * <pre>
     * A list of values that this kernel supports for this attr.
     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
     * </pre>
     *
     * <code>.tensorflow.AttrValue allowed_values = 2;</code>
     */
    public org.tensorflow.proto.framework.AttrValue getAllowedValues() {
      return allowedValues_ == null ? org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : allowedValues_;
    }
    /**
     * <pre>
     * A list of values that this kernel supports for this attr.
     * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
     * </pre>
     *
     * <code>.tensorflow.AttrValue allowed_values = 2;</code>
     */
    public org.tensorflow.proto.framework.AttrValueOrBuilder getAllowedValuesOrBuilder() {
      return getAllowedValues();
    }

    private byte memoizedIsInitialized = -1;
    @java.lang.Override
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized == 1) return true;
      if (isInitialized == 0) return false;

      memoizedIsInitialized = 1;
      return true;
    }

    @java.lang.Override
    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      if (!getNameBytes().isEmpty()) {
        com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
      }
      if (allowedValues_ != null) {
        output.writeMessage(2, getAllowedValues());
      }
      unknownFields.writeTo(output);
    }

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

      size = 0;
      if (!getNameBytes().isEmpty()) {
        size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
      }
      if (allowedValues_ != null) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, getAllowedValues());
      }
      size += unknownFields.getSerializedSize();
      memoizedSize = size;
      return size;
    }

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

      if (!getName()
          .equals(other.getName())) return false;
      if (hasAllowedValues() != other.hasAllowedValues()) return false;
      if (hasAllowedValues()) {
        if (!getAllowedValues()
            .equals(other.getAllowedValues())) return false;
      }
      if (!unknownFields.equals(other.unknownFields)) return false;
      return true;
    }

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

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

    @java.lang.Override
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder() {
      return DEFAULT_INSTANCE.toBuilder();
    }
    public static Builder newBuilder(org.tensorflow.proto.framework.KernelDef.AttrConstraint prototype) {
      return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    @java.lang.Override
    public Builder toBuilder() {
      return this == DEFAULT_INSTANCE
          ? new Builder() : new Builder().mergeFrom(this);
    }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code tensorflow.KernelDef.AttrConstraint}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
        // @@protoc_insertion_point(builder_implements:tensorflow.KernelDef.AttrConstraint)
        org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_descriptor;
      }

      @java.lang.Override
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_AttrConstraint_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.tensorflow.proto.framework.KernelDef.AttrConstraint.class, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder.class);
      }

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

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

        if (allowedValuesBuilder_ == null) {
          allowedValues_ = null;
        } else {
          allowedValues_ = null;
          allowedValuesBuilder_ = null;
        }
        return this;
      }

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

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

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

      @java.lang.Override
      public org.tensorflow.proto.framework.KernelDef.AttrConstraint buildPartial() {
        org.tensorflow.proto.framework.KernelDef.AttrConstraint result = new org.tensorflow.proto.framework.KernelDef.AttrConstraint(this);
        result.name_ = name_;
        if (allowedValuesBuilder_ == null) {
          result.allowedValues_ = allowedValues_;
        } else {
          result.allowedValues_ = allowedValuesBuilder_.build();
        }
        onBuilt();
        return result;
      }

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

      public Builder mergeFrom(org.tensorflow.proto.framework.KernelDef.AttrConstraint other) {
        if (other == org.tensorflow.proto.framework.KernelDef.AttrConstraint.getDefaultInstance()) return this;
        if (!other.getName().isEmpty()) {
          name_ = other.name_;
          onChanged();
        }
        if (other.hasAllowedValues()) {
          mergeAllowedValues(other.getAllowedValues());
        }
        this.mergeUnknownFields(other.unknownFields);
        onChanged();
        return this;
      }

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

      @java.lang.Override
      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        org.tensorflow.proto.framework.KernelDef.AttrConstraint parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.tensorflow.proto.framework.KernelDef.AttrConstraint) e.getUnfinishedMessage();
          throw e.unwrapIOException();
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }

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

      private org.tensorflow.proto.framework.AttrValue allowedValues_;
      private com.google.protobuf.SingleFieldBuilderV3<
          org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder> allowedValuesBuilder_;
      /**
       * <pre>
       * A list of values that this kernel supports for this attr.
       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
       * </pre>
       *
       * <code>.tensorflow.AttrValue allowed_values = 2;</code>
       */
      public boolean hasAllowedValues() {
        return allowedValuesBuilder_ != null || allowedValues_ != null;
      }
      /**
       * <pre>
       * A list of values that this kernel supports for this attr.
       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
       * </pre>
       *
       * <code>.tensorflow.AttrValue allowed_values = 2;</code>
       */
      public org.tensorflow.proto.framework.AttrValue getAllowedValues() {
        if (allowedValuesBuilder_ == null) {
          return allowedValues_ == null ? org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : allowedValues_;
        } else {
          return allowedValuesBuilder_.getMessage();
        }
      }
      /**
       * <pre>
       * A list of values that this kernel supports for this attr.
       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
       * </pre>
       *
       * <code>.tensorflow.AttrValue allowed_values = 2;</code>
       */
      public Builder setAllowedValues(org.tensorflow.proto.framework.AttrValue value) {
        if (allowedValuesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          allowedValues_ = value;
          onChanged();
        } else {
          allowedValuesBuilder_.setMessage(value);
        }

        return this;
      }
      /**
       * <pre>
       * A list of values that this kernel supports for this attr.
       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
       * </pre>
       *
       * <code>.tensorflow.AttrValue allowed_values = 2;</code>
       */
      public Builder setAllowedValues(
          org.tensorflow.proto.framework.AttrValue.Builder builderForValue) {
        if (allowedValuesBuilder_ == null) {
          allowedValues_ = builderForValue.build();
          onChanged();
        } else {
          allowedValuesBuilder_.setMessage(builderForValue.build());
        }

        return this;
      }
      /**
       * <pre>
       * A list of values that this kernel supports for this attr.
       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
       * </pre>
       *
       * <code>.tensorflow.AttrValue allowed_values = 2;</code>
       */
      public Builder mergeAllowedValues(org.tensorflow.proto.framework.AttrValue value) {
        if (allowedValuesBuilder_ == null) {
          if (allowedValues_ != null) {
            allowedValues_ =
              org.tensorflow.proto.framework.AttrValue.newBuilder(allowedValues_).mergeFrom(value).buildPartial();
          } else {
            allowedValues_ = value;
          }
          onChanged();
        } else {
          allowedValuesBuilder_.mergeFrom(value);
        }

        return this;
      }
      /**
       * <pre>
       * A list of values that this kernel supports for this attr.
       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
       * </pre>
       *
       * <code>.tensorflow.AttrValue allowed_values = 2;</code>
       */
      public Builder clearAllowedValues() {
        if (allowedValuesBuilder_ == null) {
          allowedValues_ = null;
          onChanged();
        } else {
          allowedValues_ = null;
          allowedValuesBuilder_ = null;
        }

        return this;
      }
      /**
       * <pre>
       * A list of values that this kernel supports for this attr.
       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
       * </pre>
       *
       * <code>.tensorflow.AttrValue allowed_values = 2;</code>
       */
      public org.tensorflow.proto.framework.AttrValue.Builder getAllowedValuesBuilder() {
        
        onChanged();
        return getAllowedValuesFieldBuilder().getBuilder();
      }
      /**
       * <pre>
       * A list of values that this kernel supports for this attr.
       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
       * </pre>
       *
       * <code>.tensorflow.AttrValue allowed_values = 2;</code>
       */
      public org.tensorflow.proto.framework.AttrValueOrBuilder getAllowedValuesOrBuilder() {
        if (allowedValuesBuilder_ != null) {
          return allowedValuesBuilder_.getMessageOrBuilder();
        } else {
          return allowedValues_ == null ?
              org.tensorflow.proto.framework.AttrValue.getDefaultInstance() : allowedValues_;
        }
      }
      /**
       * <pre>
       * A list of values that this kernel supports for this attr.
       * Like OpDef.AttrDef.allowed_values, except for kernels instead of Ops.
       * </pre>
       *
       * <code>.tensorflow.AttrValue allowed_values = 2;</code>
       */
      private com.google.protobuf.SingleFieldBuilderV3<
          org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder> 
          getAllowedValuesFieldBuilder() {
        if (allowedValuesBuilder_ == null) {
          allowedValuesBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
              org.tensorflow.proto.framework.AttrValue, org.tensorflow.proto.framework.AttrValue.Builder, org.tensorflow.proto.framework.AttrValueOrBuilder>(
                  getAllowedValues(),
                  getParentForChildren(),
                  isClean());
          allowedValues_ = null;
        }
        return allowedValuesBuilder_;
      }
      @java.lang.Override
      public final Builder setUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.setUnknownFields(unknownFields);
      }

      @java.lang.Override
      public final Builder mergeUnknownFields(
          final com.google.protobuf.UnknownFieldSet unknownFields) {
        return super.mergeUnknownFields(unknownFields);
      }


      // @@protoc_insertion_point(builder_scope:tensorflow.KernelDef.AttrConstraint)
    }

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

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

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

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

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

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

  }

  public static final int OP_FIELD_NUMBER = 1;
  private volatile java.lang.Object op_;
  /**
   * <pre>
   * Must match the name of an Op.
   * </pre>
   *
   * <code>string op = 1;</code>
   */
  public java.lang.String getOp() {
    java.lang.Object ref = op_;
    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();
      op_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Must match the name of an Op.
   * </pre>
   *
   * <code>string op = 1;</code>
   */
  public com.google.protobuf.ByteString
      getOpBytes() {
    java.lang.Object ref = op_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      op_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int DEVICE_TYPE_FIELD_NUMBER = 2;
  private volatile java.lang.Object deviceType_;
  /**
   * <pre>
   * Type of device this kernel runs on.
   * </pre>
   *
   * <code>string device_type = 2;</code>
   */
  public java.lang.String getDeviceType() {
    java.lang.Object ref = deviceType_;
    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();
      deviceType_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * Type of device this kernel runs on.
   * </pre>
   *
   * <code>string device_type = 2;</code>
   */
  public com.google.protobuf.ByteString
      getDeviceTypeBytes() {
    java.lang.Object ref = deviceType_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      deviceType_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int CONSTRAINT_FIELD_NUMBER = 3;
  private java.util.List<org.tensorflow.proto.framework.KernelDef.AttrConstraint> constraint_;
  /**
   * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
   */
  public java.util.List<org.tensorflow.proto.framework.KernelDef.AttrConstraint> getConstraintList() {
    return constraint_;
  }
  /**
   * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
   */
  public java.util.List<? extends org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder> 
      getConstraintOrBuilderList() {
    return constraint_;
  }
  /**
   * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
   */
  public int getConstraintCount() {
    return constraint_.size();
  }
  /**
   * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
   */
  public org.tensorflow.proto.framework.KernelDef.AttrConstraint getConstraint(int index) {
    return constraint_.get(index);
  }
  /**
   * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
   */
  public org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder getConstraintOrBuilder(
      int index) {
    return constraint_.get(index);
  }

  public static final int HOST_MEMORY_ARG_FIELD_NUMBER = 4;
  private com.google.protobuf.LazyStringList hostMemoryArg_;
  /**
   * <pre>
   * Names of the Op's input_/output_args that reside in host memory
   * instead of device memory.
   * </pre>
   *
   * <code>repeated string host_memory_arg = 4;</code>
   */
  public com.google.protobuf.ProtocolStringList
      getHostMemoryArgList() {
    return hostMemoryArg_;
  }
  /**
   * <pre>
   * Names of the Op's input_/output_args that reside in host memory
   * instead of device memory.
   * </pre>
   *
   * <code>repeated string host_memory_arg = 4;</code>
   */
  public int getHostMemoryArgCount() {
    return hostMemoryArg_.size();
  }
  /**
   * <pre>
   * Names of the Op's input_/output_args that reside in host memory
   * instead of device memory.
   * </pre>
   *
   * <code>repeated string host_memory_arg = 4;</code>
   */
  public java.lang.String getHostMemoryArg(int index) {
    return hostMemoryArg_.get(index);
  }
  /**
   * <pre>
   * Names of the Op's input_/output_args that reside in host memory
   * instead of device memory.
   * </pre>
   *
   * <code>repeated string host_memory_arg = 4;</code>
   */
  public com.google.protobuf.ByteString
      getHostMemoryArgBytes(int index) {
    return hostMemoryArg_.getByteString(index);
  }

  public static final int LABEL_FIELD_NUMBER = 5;
  private volatile java.lang.Object label_;
  /**
   * <pre>
   * This allows experimental kernels to be registered for an op that
   * won't be used unless the user specifies a "_kernel" attr with
   * value matching this.
   * </pre>
   *
   * <code>string label = 5;</code>
   */
  public java.lang.String getLabel() {
    java.lang.Object ref = label_;
    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();
      label_ = s;
      return s;
    }
  }
  /**
   * <pre>
   * This allows experimental kernels to be registered for an op that
   * won't be used unless the user specifies a "_kernel" attr with
   * value matching this.
   * </pre>
   *
   * <code>string label = 5;</code>
   */
  public com.google.protobuf.ByteString
      getLabelBytes() {
    java.lang.Object ref = label_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      label_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int PRIORITY_FIELD_NUMBER = 6;
  private int priority_;
  /**
   * <pre>
   * Prioritization of kernel amongst different devices. By default we assume
   * priority is 0. The higher the priority the better. By default (i.e. if
   * this is not set), we prefer GPU kernels over CPU.
   * </pre>
   *
   * <code>int32 priority = 6;</code>
   */
  public int getPriority() {
    return priority_;
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!getOpBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, op_);
    }
    if (!getDeviceTypeBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, deviceType_);
    }
    for (int i = 0; i < constraint_.size(); i++) {
      output.writeMessage(3, constraint_.get(i));
    }
    for (int i = 0; i < hostMemoryArg_.size(); i++) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, hostMemoryArg_.getRaw(i));
    }
    if (!getLabelBytes().isEmpty()) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 5, label_);
    }
    if (priority_ != 0) {
      output.writeInt32(6, priority_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!getOpBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, op_);
    }
    if (!getDeviceTypeBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, deviceType_);
    }
    for (int i = 0; i < constraint_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(3, constraint_.get(i));
    }
    {
      int dataSize = 0;
      for (int i = 0; i < hostMemoryArg_.size(); i++) {
        dataSize += computeStringSizeNoTag(hostMemoryArg_.getRaw(i));
      }
      size += dataSize;
      size += 1 * getHostMemoryArgList().size();
    }
    if (!getLabelBytes().isEmpty()) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, label_);
    }
    if (priority_ != 0) {
      size += com.google.protobuf.CodedOutputStream
        .computeInt32Size(6, priority_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

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

    if (!getOp()
        .equals(other.getOp())) return false;
    if (!getDeviceType()
        .equals(other.getDeviceType())) return false;
    if (!getConstraintList()
        .equals(other.getConstraintList())) return false;
    if (!getHostMemoryArgList()
        .equals(other.getHostMemoryArgList())) return false;
    if (!getLabel()
        .equals(other.getLabel())) return false;
    if (getPriority()
        != other.getPriority()) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + OP_FIELD_NUMBER;
    hash = (53 * hash) + getOp().hashCode();
    hash = (37 * hash) + DEVICE_TYPE_FIELD_NUMBER;
    hash = (53 * hash) + getDeviceType().hashCode();
    if (getConstraintCount() > 0) {
      hash = (37 * hash) + CONSTRAINT_FIELD_NUMBER;
      hash = (53 * hash) + getConstraintList().hashCode();
    }
    if (getHostMemoryArgCount() > 0) {
      hash = (37 * hash) + HOST_MEMORY_ARG_FIELD_NUMBER;
      hash = (53 * hash) + getHostMemoryArgList().hashCode();
    }
    hash = (37 * hash) + LABEL_FIELD_NUMBER;
    hash = (53 * hash) + getLabel().hashCode();
    hash = (37 * hash) + PRIORITY_FIELD_NUMBER;
    hash = (53 * hash) + getPriority();
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

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

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(org.tensorflow.proto.framework.KernelDef prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * Protobuf type {@code tensorflow.KernelDef}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:tensorflow.KernelDef)
      org.tensorflow.proto.framework.KernelDefOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.tensorflow.proto.framework.KernelDefProtos.internal_static_tensorflow_KernelDef_descriptor;
    }

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

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

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

      deviceType_ = "";

      if (constraintBuilder_ == null) {
        constraint_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        constraintBuilder_.clear();
      }
      hostMemoryArg_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      label_ = "";

      priority_ = 0;

      return this;
    }

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

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

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

    @java.lang.Override
    public org.tensorflow.proto.framework.KernelDef buildPartial() {
      org.tensorflow.proto.framework.KernelDef result = new org.tensorflow.proto.framework.KernelDef(this);
      int from_bitField0_ = bitField0_;
      result.op_ = op_;
      result.deviceType_ = deviceType_;
      if (constraintBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          constraint_ = java.util.Collections.unmodifiableList(constraint_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.constraint_ = constraint_;
      } else {
        result.constraint_ = constraintBuilder_.build();
      }
      if (((bitField0_ & 0x00000002) != 0)) {
        hostMemoryArg_ = hostMemoryArg_.getUnmodifiableView();
        bitField0_ = (bitField0_ & ~0x00000002);
      }
      result.hostMemoryArg_ = hostMemoryArg_;
      result.label_ = label_;
      result.priority_ = priority_;
      onBuilt();
      return result;
    }

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

    public Builder mergeFrom(org.tensorflow.proto.framework.KernelDef other) {
      if (other == org.tensorflow.proto.framework.KernelDef.getDefaultInstance()) return this;
      if (!other.getOp().isEmpty()) {
        op_ = other.op_;
        onChanged();
      }
      if (!other.getDeviceType().isEmpty()) {
        deviceType_ = other.deviceType_;
        onChanged();
      }
      if (constraintBuilder_ == null) {
        if (!other.constraint_.isEmpty()) {
          if (constraint_.isEmpty()) {
            constraint_ = other.constraint_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureConstraintIsMutable();
            constraint_.addAll(other.constraint_);
          }
          onChanged();
        }
      } else {
        if (!other.constraint_.isEmpty()) {
          if (constraintBuilder_.isEmpty()) {
            constraintBuilder_.dispose();
            constraintBuilder_ = null;
            constraint_ = other.constraint_;
            bitField0_ = (bitField0_ & ~0x00000001);
            constraintBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getConstraintFieldBuilder() : null;
          } else {
            constraintBuilder_.addAllMessages(other.constraint_);
          }
        }
      }
      if (!other.hostMemoryArg_.isEmpty()) {
        if (hostMemoryArg_.isEmpty()) {
          hostMemoryArg_ = other.hostMemoryArg_;
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          ensureHostMemoryArgIsMutable();
          hostMemoryArg_.addAll(other.hostMemoryArg_);
        }
        onChanged();
      }
      if (!other.getLabel().isEmpty()) {
        label_ = other.label_;
        onChanged();
      }
      if (other.getPriority() != 0) {
        setPriority(other.getPriority());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

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

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

    private java.lang.Object op_ = "";
    /**
     * <pre>
     * Must match the name of an Op.
     * </pre>
     *
     * <code>string op = 1;</code>
     */
    public java.lang.String getOp() {
      java.lang.Object ref = op_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        op_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Must match the name of an Op.
     * </pre>
     *
     * <code>string op = 1;</code>
     */
    public com.google.protobuf.ByteString
        getOpBytes() {
      java.lang.Object ref = op_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        op_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Must match the name of an Op.
     * </pre>
     *
     * <code>string op = 1;</code>
     */
    public Builder setOp(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      op_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Must match the name of an Op.
     * </pre>
     *
     * <code>string op = 1;</code>
     */
    public Builder clearOp() {
      
      op_ = getDefaultInstance().getOp();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Must match the name of an Op.
     * </pre>
     *
     * <code>string op = 1;</code>
     */
    public Builder setOpBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      op_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object deviceType_ = "";
    /**
     * <pre>
     * Type of device this kernel runs on.
     * </pre>
     *
     * <code>string device_type = 2;</code>
     */
    public java.lang.String getDeviceType() {
      java.lang.Object ref = deviceType_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        deviceType_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * Type of device this kernel runs on.
     * </pre>
     *
     * <code>string device_type = 2;</code>
     */
    public com.google.protobuf.ByteString
        getDeviceTypeBytes() {
      java.lang.Object ref = deviceType_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        deviceType_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * Type of device this kernel runs on.
     * </pre>
     *
     * <code>string device_type = 2;</code>
     */
    public Builder setDeviceType(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      deviceType_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Type of device this kernel runs on.
     * </pre>
     *
     * <code>string device_type = 2;</code>
     */
    public Builder clearDeviceType() {
      
      deviceType_ = getDefaultInstance().getDeviceType();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Type of device this kernel runs on.
     * </pre>
     *
     * <code>string device_type = 2;</code>
     */
    public Builder setDeviceTypeBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      deviceType_ = value;
      onChanged();
      return this;
    }

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

    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.framework.KernelDef.AttrConstraint, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder, org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder> constraintBuilder_;

    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public java.util.List<org.tensorflow.proto.framework.KernelDef.AttrConstraint> getConstraintList() {
      if (constraintBuilder_ == null) {
        return java.util.Collections.unmodifiableList(constraint_);
      } else {
        return constraintBuilder_.getMessageList();
      }
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public int getConstraintCount() {
      if (constraintBuilder_ == null) {
        return constraint_.size();
      } else {
        return constraintBuilder_.getCount();
      }
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public org.tensorflow.proto.framework.KernelDef.AttrConstraint getConstraint(int index) {
      if (constraintBuilder_ == null) {
        return constraint_.get(index);
      } else {
        return constraintBuilder_.getMessage(index);
      }
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public Builder setConstraint(
        int index, org.tensorflow.proto.framework.KernelDef.AttrConstraint value) {
      if (constraintBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureConstraintIsMutable();
        constraint_.set(index, value);
        onChanged();
      } else {
        constraintBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public Builder setConstraint(
        int index, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder builderForValue) {
      if (constraintBuilder_ == null) {
        ensureConstraintIsMutable();
        constraint_.set(index, builderForValue.build());
        onChanged();
      } else {
        constraintBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public Builder addConstraint(org.tensorflow.proto.framework.KernelDef.AttrConstraint value) {
      if (constraintBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureConstraintIsMutable();
        constraint_.add(value);
        onChanged();
      } else {
        constraintBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public Builder addConstraint(
        int index, org.tensorflow.proto.framework.KernelDef.AttrConstraint value) {
      if (constraintBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureConstraintIsMutable();
        constraint_.add(index, value);
        onChanged();
      } else {
        constraintBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public Builder addConstraint(
        org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder builderForValue) {
      if (constraintBuilder_ == null) {
        ensureConstraintIsMutable();
        constraint_.add(builderForValue.build());
        onChanged();
      } else {
        constraintBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public Builder addConstraint(
        int index, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder builderForValue) {
      if (constraintBuilder_ == null) {
        ensureConstraintIsMutable();
        constraint_.add(index, builderForValue.build());
        onChanged();
      } else {
        constraintBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public Builder addAllConstraint(
        java.lang.Iterable<? extends org.tensorflow.proto.framework.KernelDef.AttrConstraint> values) {
      if (constraintBuilder_ == null) {
        ensureConstraintIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, constraint_);
        onChanged();
      } else {
        constraintBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public Builder clearConstraint() {
      if (constraintBuilder_ == null) {
        constraint_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        constraintBuilder_.clear();
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public Builder removeConstraint(int index) {
      if (constraintBuilder_ == null) {
        ensureConstraintIsMutable();
        constraint_.remove(index);
        onChanged();
      } else {
        constraintBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder getConstraintBuilder(
        int index) {
      return getConstraintFieldBuilder().getBuilder(index);
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder getConstraintOrBuilder(
        int index) {
      if (constraintBuilder_ == null) {
        return constraint_.get(index);  } else {
        return constraintBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public java.util.List<? extends org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder> 
         getConstraintOrBuilderList() {
      if (constraintBuilder_ != null) {
        return constraintBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(constraint_);
      }
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder addConstraintBuilder() {
      return getConstraintFieldBuilder().addBuilder(
          org.tensorflow.proto.framework.KernelDef.AttrConstraint.getDefaultInstance());
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder addConstraintBuilder(
        int index) {
      return getConstraintFieldBuilder().addBuilder(
          index, org.tensorflow.proto.framework.KernelDef.AttrConstraint.getDefaultInstance());
    }
    /**
     * <code>repeated .tensorflow.KernelDef.AttrConstraint constraint = 3;</code>
     */
    public java.util.List<org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder> 
         getConstraintBuilderList() {
      return getConstraintFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        org.tensorflow.proto.framework.KernelDef.AttrConstraint, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder, org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder> 
        getConstraintFieldBuilder() {
      if (constraintBuilder_ == null) {
        constraintBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            org.tensorflow.proto.framework.KernelDef.AttrConstraint, org.tensorflow.proto.framework.KernelDef.AttrConstraint.Builder, org.tensorflow.proto.framework.KernelDef.AttrConstraintOrBuilder>(
                constraint_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        constraint_ = null;
      }
      return constraintBuilder_;
    }

    private com.google.protobuf.LazyStringList hostMemoryArg_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    private void ensureHostMemoryArgIsMutable() {
      if (!((bitField0_ & 0x00000002) != 0)) {
        hostMemoryArg_ = new com.google.protobuf.LazyStringArrayList(hostMemoryArg_);
        bitField0_ |= 0x00000002;
       }
    }
    /**
     * <pre>
     * Names of the Op's input_/output_args that reside in host memory
     * instead of device memory.
     * </pre>
     *
     * <code>repeated string host_memory_arg = 4;</code>
     */
    public com.google.protobuf.ProtocolStringList
        getHostMemoryArgList() {
      return hostMemoryArg_.getUnmodifiableView();
    }
    /**
     * <pre>
     * Names of the Op's input_/output_args that reside in host memory
     * instead of device memory.
     * </pre>
     *
     * <code>repeated string host_memory_arg = 4;</code>
     */
    public int getHostMemoryArgCount() {
      return hostMemoryArg_.size();
    }
    /**
     * <pre>
     * Names of the Op's input_/output_args that reside in host memory
     * instead of device memory.
     * </pre>
     *
     * <code>repeated string host_memory_arg = 4;</code>
     */
    public java.lang.String getHostMemoryArg(int index) {
      return hostMemoryArg_.get(index);
    }
    /**
     * <pre>
     * Names of the Op's input_/output_args that reside in host memory
     * instead of device memory.
     * </pre>
     *
     * <code>repeated string host_memory_arg = 4;</code>
     */
    public com.google.protobuf.ByteString
        getHostMemoryArgBytes(int index) {
      return hostMemoryArg_.getByteString(index);
    }
    /**
     * <pre>
     * Names of the Op's input_/output_args that reside in host memory
     * instead of device memory.
     * </pre>
     *
     * <code>repeated string host_memory_arg = 4;</code>
     */
    public Builder setHostMemoryArg(
        int index, java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureHostMemoryArgIsMutable();
      hostMemoryArg_.set(index, value);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Names of the Op's input_/output_args that reside in host memory
     * instead of device memory.
     * </pre>
     *
     * <code>repeated string host_memory_arg = 4;</code>
     */
    public Builder addHostMemoryArg(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  ensureHostMemoryArgIsMutable();
      hostMemoryArg_.add(value);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Names of the Op's input_/output_args that reside in host memory
     * instead of device memory.
     * </pre>
     *
     * <code>repeated string host_memory_arg = 4;</code>
     */
    public Builder addAllHostMemoryArg(
        java.lang.Iterable<java.lang.String> values) {
      ensureHostMemoryArgIsMutable();
      com.google.protobuf.AbstractMessageLite.Builder.addAll(
          values, hostMemoryArg_);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Names of the Op's input_/output_args that reside in host memory
     * instead of device memory.
     * </pre>
     *
     * <code>repeated string host_memory_arg = 4;</code>
     */
    public Builder clearHostMemoryArg() {
      hostMemoryArg_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      bitField0_ = (bitField0_ & ~0x00000002);
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Names of the Op's input_/output_args that reside in host memory
     * instead of device memory.
     * </pre>
     *
     * <code>repeated string host_memory_arg = 4;</code>
     */
    public Builder addHostMemoryArgBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      ensureHostMemoryArgIsMutable();
      hostMemoryArg_.add(value);
      onChanged();
      return this;
    }

    private java.lang.Object label_ = "";
    /**
     * <pre>
     * This allows experimental kernels to be registered for an op that
     * won't be used unless the user specifies a "_kernel" attr with
     * value matching this.
     * </pre>
     *
     * <code>string label = 5;</code>
     */
    public java.lang.String getLabel() {
      java.lang.Object ref = label_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        label_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <pre>
     * This allows experimental kernels to be registered for an op that
     * won't be used unless the user specifies a "_kernel" attr with
     * value matching this.
     * </pre>
     *
     * <code>string label = 5;</code>
     */
    public com.google.protobuf.ByteString
        getLabelBytes() {
      java.lang.Object ref = label_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        label_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <pre>
     * This allows experimental kernels to be registered for an op that
     * won't be used unless the user specifies a "_kernel" attr with
     * value matching this.
     * </pre>
     *
     * <code>string label = 5;</code>
     */
    public Builder setLabel(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      label_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * This allows experimental kernels to be registered for an op that
     * won't be used unless the user specifies a "_kernel" attr with
     * value matching this.
     * </pre>
     *
     * <code>string label = 5;</code>
     */
    public Builder clearLabel() {
      
      label_ = getDefaultInstance().getLabel();
      onChanged();
      return this;
    }
    /**
     * <pre>
     * This allows experimental kernels to be registered for an op that
     * won't be used unless the user specifies a "_kernel" attr with
     * value matching this.
     * </pre>
     *
     * <code>string label = 5;</code>
     */
    public Builder setLabelBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      label_ = value;
      onChanged();
      return this;
    }

    private int priority_ ;
    /**
     * <pre>
     * Prioritization of kernel amongst different devices. By default we assume
     * priority is 0. The higher the priority the better. By default (i.e. if
     * this is not set), we prefer GPU kernels over CPU.
     * </pre>
     *
     * <code>int32 priority = 6;</code>
     */
    public int getPriority() {
      return priority_;
    }
    /**
     * <pre>
     * Prioritization of kernel amongst different devices. By default we assume
     * priority is 0. The higher the priority the better. By default (i.e. if
     * this is not set), we prefer GPU kernels over CPU.
     * </pre>
     *
     * <code>int32 priority = 6;</code>
     */
    public Builder setPriority(int value) {
      
      priority_ = value;
      onChanged();
      return this;
    }
    /**
     * <pre>
     * Prioritization of kernel amongst different devices. By default we assume
     * priority is 0. The higher the priority the better. By default (i.e. if
     * this is not set), we prefer GPU kernels over CPU.
     * </pre>
     *
     * <code>int32 priority = 6;</code>
     */
    public Builder clearPriority() {
      
      priority_ = 0;
      onChanged();
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

    @java.lang.Override
    public final Builder mergeUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.mergeUnknownFields(unknownFields);
    }


    // @@protoc_insertion_point(builder_scope:tensorflow.KernelDef)
  }

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

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

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

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

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

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

}

