content: /*
   * Tencent is pleased to support the open source community by making Angel available.
   *
   * Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
   *
   * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
   * compliance with the License. You may obtain a copy of the License at
   *
   * https://opensource.org/licenses/Apache-2.0
   *
   * Unless required by applicable law or agreed to in writing, software distributed under the License
   * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
   * or implied. See the License for the specific language governing permissions and limitations under
   * the License.
   *
   */
  // Generated by the protocol buffer compiler.  DO NOT EDIT!
  // source: core/graph/node_def.proto
  
  package com.tencent.angel.core.graph;
  
  public final class NodeProto {
    private NodeProto() {}
    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 NodeDefOrBuilder extends
        // @@protoc_insertion_point(interface_extends:angel.NodeDef)
        com.google.protobuf.MessageOrBuilder {
  
      /**
       * <pre>
       * The name given to this operator. Used for naming inputs,
       * logging, visualization, etc.  Unique within a single GraphDef.
       * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*".
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      java.lang.String getName();
      /**
       * <pre>
       * The name given to this operator. Used for naming inputs,
       * logging, visualization, etc.  Unique within a single GraphDef.
       * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*".
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      com.google.protobuf.ByteString
          getNameBytes();
  
      /**
       * <pre>
       * The operation name.  There may be custom parameters in attrs.
       * Op names starting with an underscore are reserved for internal use.
       * </pre>
       *
       * <code>string op = 2;</code>
       */
      java.lang.String getOp();
      /**
       * <pre>
       * The operation name.  There may be custom parameters in attrs.
       * Op names starting with an underscore are reserved for internal use.
       * </pre>
       *
       * <code>string op = 2;</code>
       */
      com.google.protobuf.ByteString
          getOpBytes();
  
      /**
       * <pre>
       * Each input is "node:src_output" with "node" being a string name and
       * "src_output" indicating which output tensor to use from "node". If
       * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
       * may optionally be followed by control inputs that have the format
       * "^node".
       * </pre>
       *
       * <code>repeated string input = 3;</code>
       */
      java.util.List<java.lang.String>
          getInputList();
      /**
       * <pre>
       * Each input is "node:src_output" with "node" being a string name and
       * "src_output" indicating which output tensor to use from "node". If
       * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
       * may optionally be followed by control inputs that have the format
       * "^node".
       * </pre>
       *
       * <code>repeated string input = 3;</code>
       */
      int getInputCount();
      /**
       * <pre>
       * Each input is "node:src_output" with "node" being a string name and
       * "src_output" indicating which output tensor to use from "node". If
       * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
       * may optionally be followed by control inputs that have the format
       * "^node".
       * </pre>
       *
       * <code>repeated string input = 3;</code>
       */
      java.lang.String getInput(int index);
      /**
       * <pre>
       * Each input is "node:src_output" with "node" being a string name and
       * "src_output" indicating which output tensor to use from "node". If
       * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
       * may optionally be followed by control inputs that have the format
       * "^node".
       * </pre>
       *
       * <code>repeated string input = 3;</code>
       */
      com.google.protobuf.ByteString
          getInputBytes(int index);
  
      /**
       * <pre>
       * A (possibly partial) specification for the device on which this
       * node should be placed.
       * The expected syntax for this string is as follows:
       * DEVICE_SPEC ::= PARTIAL_SPEC
       * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
       * CONSTRAINT ::= ("job:" JOB_NAME)
       *              | ("replica:" [1-9][0-9]*)
       *              | ("task:" [1-9][0-9]*)
       *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
       * Valid values for this string include:
       * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
       * * "/job:worker/device:GPU:3"                   (partial specification)
       * * ""                                    (no specification)
       * If the constraints do not resolve to a single device (or if this
       * field is empty or not present), the runtime will attempt to
       * choose a device automatically.
       * </pre>
       *
       * <code>string device = 4;</code>
       */
      java.lang.String getDevice();
      /**
       * <pre>
       * A (possibly partial) specification for the device on which this
       * node should be placed.
       * The expected syntax for this string is as follows:
       * DEVICE_SPEC ::= PARTIAL_SPEC
       * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
       * CONSTRAINT ::= ("job:" JOB_NAME)
       *              | ("replica:" [1-9][0-9]*)
       *              | ("task:" [1-9][0-9]*)
       *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
       * Valid values for this string include:
       * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
       * * "/job:worker/device:GPU:3"                   (partial specification)
       * * ""                                    (no specification)
       * If the constraints do not resolve to a single device (or if this
       * field is empty or not present), the runtime will attempt to
       * choose a device automatically.
       * </pre>
       *
       * <code>string device = 4;</code>
       */
      com.google.protobuf.ByteString
          getDeviceBytes();
  
      /**
       * <pre>
       * Operation-specific graph-construction-time configuration.
       * Note that this should include all attrs defined in the
       * corresponding OpDef, including those with a value matching
       * the default -- this allows the default to change and makes
       * NodeDefs easier to interpret on their own.  However, if
       * an attr with a default is not specified in this list, the
       * default will be used.
       * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
       * one of the names from the corresponding OpDef's attr field).
       * The values must have a type matching the corresponding OpDef
       * attr's type field.
       * TODO(josh11b): Add some examples here showing best practices.
       * </pre>
       *
       * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
       */
      int getAttrCount();
      /**
       * <pre>
       * Operation-specific graph-construction-time configuration.
       * Note that this should include all attrs defined in the
       * corresponding OpDef, including those with a value matching
       * the default -- this allows the default to change and makes
       * NodeDefs easier to interpret on their own.  However, if
       * an attr with a default is not specified in this list, the
       * default will be used.
       * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
       * one of the names from the corresponding OpDef's attr field).
       * The values must have a type matching the corresponding OpDef
       * attr's type field.
       * TODO(josh11b): Add some examples here showing best practices.
       * </pre>
       *
       * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
       */
      boolean containsAttr(
          java.lang.String key);
      /**
       * Use {@link #getAttrMap()} instead.
       */
      @java.lang.Deprecated
      java.util.Map<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue>
      getAttr();
      /**
       * <pre>
       * Operation-specific graph-construction-time configuration.
       * Note that this should include all attrs defined in the
       * corresponding OpDef, including those with a value matching
       * the default -- this allows the default to change and makes
       * NodeDefs easier to interpret on their own.  However, if
       * an attr with a default is not specified in this list, the
       * default will be used.
       * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
       * one of the names from the corresponding OpDef's attr field).
       * The values must have a type matching the corresponding OpDef
       * attr's type field.
       * TODO(josh11b): Add some examples here showing best practices.
       * </pre>
       *
       * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
       */
      java.util.Map<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue>
      getAttrMap();
      /**
       * <pre>
       * Operation-specific graph-construction-time configuration.
       * Note that this should include all attrs defined in the
       * corresponding OpDef, including those with a value matching
       * the default -- this allows the default to change and makes
       * NodeDefs easier to interpret on their own.  However, if
       * an attr with a default is not specified in this list, the
       * default will be used.
       * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
       * one of the names from the corresponding OpDef's attr field).
       * The values must have a type matching the corresponding OpDef
       * attr's type field.
       * TODO(josh11b): Add some examples here showing best practices.
       * </pre>
       *
       * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
       */
  
      com.tencent.angel.core.graph.AttrValueProtos.AttrValue getAttrOrDefault(
          java.lang.String key,
          com.tencent.angel.core.graph.AttrValueProtos.AttrValue defaultValue);
      /**
       * <pre>
       * Operation-specific graph-construction-time configuration.
       * Note that this should include all attrs defined in the
       * corresponding OpDef, including those with a value matching
       * the default -- this allows the default to change and makes
       * NodeDefs easier to interpret on their own.  However, if
       * an attr with a default is not specified in this list, the
       * default will be used.
       * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
       * one of the names from the corresponding OpDef's attr field).
       * The values must have a type matching the corresponding OpDef
       * attr's type field.
       * TODO(josh11b): Add some examples here showing best practices.
       * </pre>
       *
       * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
       */
  
      com.tencent.angel.core.graph.AttrValueProtos.AttrValue getAttrOrThrow(
          java.lang.String key);
    }
    /**
     * Protobuf type {@code angel.NodeDef}
     */
    public  static final class NodeDef extends
        com.google.protobuf.GeneratedMessageV3 implements
        // @@protoc_insertion_point(message_implements:angel.NodeDef)
        NodeDefOrBuilder {
    private static final long serialVersionUID = 0L;
      // Use NodeDef.newBuilder() to construct.
      private NodeDef(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
        super(builder);
      }
      private NodeDef() {
        name_ = "";
        op_ = "";
        input_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        device_ = "";
      }
  
      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet
      getUnknownFields() {
        return this.unknownFields;
      }
      private NodeDef(
          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;
              default: {
                if (!parseUnknownFieldProto3(
                    input, unknownFields, extensionRegistry, tag)) {
                  done = true;
                }
                break;
              }
              case 10: {
                java.lang.String s = input.readStringRequireUtf8();
  
                name_ = s;
                break;
              }
              case 18: {
                java.lang.String s = input.readStringRequireUtf8();
  
                op_ = s;
                break;
              }
              case 26: {
                java.lang.String s = input.readStringRequireUtf8();
                if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
                  input_ = new com.google.protobuf.LazyStringArrayList();
                  mutable_bitField0_ |= 0x00000004;
                }
                input_.add(s);
                break;
              }
              case 34: {
                java.lang.String s = input.readStringRequireUtf8();
  
                device_ = s;
                break;
              }
              case 42: {
                if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
                  attr_ = com.google.protobuf.MapField.newMapField(
                      AttrDefaultEntryHolder.defaultEntry);
                  mutable_bitField0_ |= 0x00000010;
                }
                com.google.protobuf.MapEntry<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue>
                attr__ = input.readMessage(
                    AttrDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
                attr_.getMutableMap().put(
                    attr__.getKey(), attr__.getValue());
                break;
              }
            }
          }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.setUnfinishedMessage(this);
        } catch (java.io.IOException e) {
          throw new com.google.protobuf.InvalidProtocolBufferException(
              e).setUnfinishedMessage(this);
        } finally {
          if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
            input_ = input_.getUnmodifiableView();
          }
          this.unknownFields = unknownFields.build();
          makeExtensionsImmutable();
        }
      }
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.tencent.angel.core.graph.NodeProto.internal_static_angel_NodeDef_descriptor;
      }
  
      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMapField(
          int number) {
        switch (number) {
          case 5:
            return internalGetAttr();
          default:
            throw new RuntimeException(
                "Invalid map field number: " + number);
        }
      }
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.tencent.angel.core.graph.NodeProto.internal_static_angel_NodeDef_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.tencent.angel.core.graph.NodeProto.NodeDef.class, com.tencent.angel.core.graph.NodeProto.NodeDef.Builder.class);
      }
  
      private int bitField0_;
      public static final int NAME_FIELD_NUMBER = 1;
      private volatile java.lang.Object name_;
      /**
       * <pre>
       * The name given to this operator. Used for naming inputs,
       * logging, visualization, etc.  Unique within a single GraphDef.
       * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*".
       * </pre>
       *
       * <code>string name = 1;</code>
       */
      public java.lang.String getName() {
        java.lang.Object ref = name_;
        if (ref instanceof java.lang.String) {
          return (java.lang.String) ref;
        } else {
          com.google.protobuf.ByteString bs = 
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          name_ = s;
          return s;
        }
      }
      /**
       * <pre>
       * The name given to this operator. Used for naming inputs,
       * logging, visualization, etc.  Unique within a single GraphDef.
       * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*".
       * </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 OP_FIELD_NUMBER = 2;
      private volatile java.lang.Object op_;
      /**
       * <pre>
       * The operation name.  There may be custom parameters in attrs.
       * Op names starting with an underscore are reserved for internal use.
       * </pre>
       *
       * <code>string op = 2;</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>
       * The operation name.  There may be custom parameters in attrs.
       * Op names starting with an underscore are reserved for internal use.
       * </pre>
       *
       * <code>string op = 2;</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 INPUT_FIELD_NUMBER = 3;
      private com.google.protobuf.LazyStringList input_;
      /**
       * <pre>
       * Each input is "node:src_output" with "node" being a string name and
       * "src_output" indicating which output tensor to use from "node". If
       * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
       * may optionally be followed by control inputs that have the format
       * "^node".
       * </pre>
       *
       * <code>repeated string input = 3;</code>
       */
      public com.google.protobuf.ProtocolStringList
          getInputList() {
        return input_;
      }
      /**
       * <pre>
       * Each input is "node:src_output" with "node" being a string name and
       * "src_output" indicating which output tensor to use from "node". If
       * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
       * may optionally be followed by control inputs that have the format
       * "^node".
       * </pre>
       *
       * <code>repeated string input = 3;</code>
       */
      public int getInputCount() {
        return input_.size();
      }
      /**
       * <pre>
       * Each input is "node:src_output" with "node" being a string name and
       * "src_output" indicating which output tensor to use from "node". If
       * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
       * may optionally be followed by control inputs that have the format
       * "^node".
       * </pre>
       *
       * <code>repeated string input = 3;</code>
       */
      public java.lang.String getInput(int index) {
        return input_.get(index);
      }
      /**
       * <pre>
       * Each input is "node:src_output" with "node" being a string name and
       * "src_output" indicating which output tensor to use from "node". If
       * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
       * may optionally be followed by control inputs that have the format
       * "^node".
       * </pre>
       *
       * <code>repeated string input = 3;</code>
       */
      public com.google.protobuf.ByteString
          getInputBytes(int index) {
        return input_.getByteString(index);
      }
  
      public static final int DEVICE_FIELD_NUMBER = 4;
      private volatile java.lang.Object device_;
      /**
       * <pre>
       * A (possibly partial) specification for the device on which this
       * node should be placed.
       * The expected syntax for this string is as follows:
       * DEVICE_SPEC ::= PARTIAL_SPEC
       * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
       * CONSTRAINT ::= ("job:" JOB_NAME)
       *              | ("replica:" [1-9][0-9]*)
       *              | ("task:" [1-9][0-9]*)
       *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
       * Valid values for this string include:
       * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
       * * "/job:worker/device:GPU:3"                   (partial specification)
       * * ""                                    (no specification)
       * If the constraints do not resolve to a single device (or if this
       * field is empty or not present), the runtime will attempt to
       * choose a device automatically.
       * </pre>
       *
       * <code>string device = 4;</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>
       * A (possibly partial) specification for the device on which this
       * node should be placed.
       * The expected syntax for this string is as follows:
       * DEVICE_SPEC ::= PARTIAL_SPEC
       * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
       * CONSTRAINT ::= ("job:" JOB_NAME)
       *              | ("replica:" [1-9][0-9]*)
       *              | ("task:" [1-9][0-9]*)
       *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
       * Valid values for this string include:
       * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
       * * "/job:worker/device:GPU:3"                   (partial specification)
       * * ""                                    (no specification)
       * If the constraints do not resolve to a single device (or if this
       * field is empty or not present), the runtime will attempt to
       * choose a device automatically.
       * </pre>
       *
       * <code>string device = 4;</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 ATTR_FIELD_NUMBER = 5;
      private static final class AttrDefaultEntryHolder {
        static final com.google.protobuf.MapEntry<
            java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> defaultEntry =
                com.google.protobuf.MapEntry
                .<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue>newDefaultInstance(
                    com.tencent.angel.core.graph.NodeProto.internal_static_angel_NodeDef_AttrEntry_descriptor, 
                    com.google.protobuf.WireFormat.FieldType.STRING,
                    "",
                    com.google.protobuf.WireFormat.FieldType.MESSAGE,
                    com.tencent.angel.core.graph.AttrValueProtos.AttrValue.getDefaultInstance());
      }
      private com.google.protobuf.MapField<
          java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> attr_;
      private com.google.protobuf.MapField<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue>
      internalGetAttr() {
        if (attr_ == null) {
          return com.google.protobuf.MapField.emptyMapField(
              AttrDefaultEntryHolder.defaultEntry);
        }
        return attr_;
      }
  
      public int getAttrCount() {
        return internalGetAttr().getMap().size();
      }
      /**
       * <pre>
       * Operation-specific graph-construction-time configuration.
       * Note that this should include all attrs defined in the
       * corresponding OpDef, including those with a value matching
       * the default -- this allows the default to change and makes
       * NodeDefs easier to interpret on their own.  However, if
       * an attr with a default is not specified in this list, the
       * default will be used.
       * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
       * one of the names from the corresponding OpDef's attr field).
       * The values must have a type matching the corresponding OpDef
       * attr's type field.
       * TODO(josh11b): Add some examples here showing best practices.
       * </pre>
       *
       * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
       */
  
      public boolean containsAttr(
          java.lang.String key) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        return internalGetAttr().getMap().containsKey(key);
      }
      /**
       * Use {@link #getAttrMap()} instead.
       */
      @java.lang.Deprecated
      public java.util.Map<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> getAttr() {
        return getAttrMap();
      }
      /**
       * <pre>
       * Operation-specific graph-construction-time configuration.
       * Note that this should include all attrs defined in the
       * corresponding OpDef, including those with a value matching
       * the default -- this allows the default to change and makes
       * NodeDefs easier to interpret on their own.  However, if
       * an attr with a default is not specified in this list, the
       * default will be used.
       * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
       * one of the names from the corresponding OpDef's attr field).
       * The values must have a type matching the corresponding OpDef
       * attr's type field.
       * TODO(josh11b): Add some examples here showing best practices.
       * </pre>
       *
       * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
       */
  
      public java.util.Map<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> getAttrMap() {
        return internalGetAttr().getMap();
      }
      /**
       * <pre>
       * Operation-specific graph-construction-time configuration.
       * Note that this should include all attrs defined in the
       * corresponding OpDef, including those with a value matching
       * the default -- this allows the default to change and makes
       * NodeDefs easier to interpret on their own.  However, if
       * an attr with a default is not specified in this list, the
       * default will be used.
       * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
       * one of the names from the corresponding OpDef's attr field).
       * The values must have a type matching the corresponding OpDef
       * attr's type field.
       * TODO(josh11b): Add some examples here showing best practices.
       * </pre>
       *
       * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
       */
  
      public com.tencent.angel.core.graph.AttrValueProtos.AttrValue getAttrOrDefault(
          java.lang.String key,
          com.tencent.angel.core.graph.AttrValueProtos.AttrValue defaultValue) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        java.util.Map<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> map =
            internalGetAttr().getMap();
        return map.containsKey(key) ? map.get(key) : defaultValue;
      }
      /**
       * <pre>
       * Operation-specific graph-construction-time configuration.
       * Note that this should include all attrs defined in the
       * corresponding OpDef, including those with a value matching
       * the default -- this allows the default to change and makes
       * NodeDefs easier to interpret on their own.  However, if
       * an attr with a default is not specified in this list, the
       * default will be used.
       * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
       * one of the names from the corresponding OpDef's attr field).
       * The values must have a type matching the corresponding OpDef
       * attr's type field.
       * TODO(josh11b): Add some examples here showing best practices.
       * </pre>
       *
       * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
       */
  
      public com.tencent.angel.core.graph.AttrValueProtos.AttrValue getAttrOrThrow(
          java.lang.String key) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        java.util.Map<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> map =
            internalGetAttr().getMap();
        if (!map.containsKey(key)) {
          throw new java.lang.IllegalArgumentException();
        }
        return map.get(key);
      }
  
      private byte memoizedIsInitialized = -1;
      public final boolean isInitialized() {
        byte isInitialized = memoizedIsInitialized;
        if (isInitialized == 1) return true;
        if (isInitialized == 0) return false;
  
        memoizedIsInitialized = 1;
        return true;
      }
  
      public void writeTo(com.google.protobuf.CodedOutputStream output)
                          throws java.io.IOException {
        if (!getNameBytes().isEmpty()) {
          com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
        }
        if (!getOpBytes().isEmpty()) {
          com.google.protobuf.GeneratedMessageV3.writeString(output, 2, op_);
        }
        for (int i = 0; i < input_.size(); i++) {
          com.google.protobuf.GeneratedMessageV3.writeString(output, 3, input_.getRaw(i));
        }
        if (!getDeviceBytes().isEmpty()) {
          com.google.protobuf.GeneratedMessageV3.writeString(output, 4, device_);
        }
        com.google.protobuf.GeneratedMessageV3
          .serializeStringMapTo(
            output,
            internalGetAttr(),
            AttrDefaultEntryHolder.defaultEntry,
            5);
        unknownFields.writeTo(output);
      }
  
      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 (!getOpBytes().isEmpty()) {
          size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, op_);
        }
        {
          int dataSize = 0;
          for (int i = 0; i < input_.size(); i++) {
            dataSize += computeStringSizeNoTag(input_.getRaw(i));
          }
          size += dataSize;
          size += 1 * getInputList().size();
        }
        if (!getDeviceBytes().isEmpty()) {
          size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, device_);
        }
        for (java.util.Map.Entry<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> entry
             : internalGetAttr().getMap().entrySet()) {
          com.google.protobuf.MapEntry<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue>
          attr__ = AttrDefaultEntryHolder.defaultEntry.newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
          size += com.google.protobuf.CodedOutputStream
              .computeMessageSize(5, attr__);
        }
        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 com.tencent.angel.core.graph.NodeProto.NodeDef)) {
          return super.equals(obj);
        }
        com.tencent.angel.core.graph.NodeProto.NodeDef other = (com.tencent.angel.core.graph.NodeProto.NodeDef) obj;
  
        boolean result = true;
        result = result && getName()
            .equals(other.getName());
        result = result && getOp()
            .equals(other.getOp());
        result = result && getInputList()
            .equals(other.getInputList());
        result = result && getDevice()
            .equals(other.getDevice());
        result = result && internalGetAttr().equals(
            other.internalGetAttr());
        result = result && unknownFields.equals(other.unknownFields);
        return result;
      }
  
      @java.lang.Override
      public int hashCode() {
        if (memoizedHashCode != 0) {
          return memoizedHashCode;
        }
        int hash = 41;
        hash = (19 * hash) + getDescriptor().hashCode();
        hash = (37 * hash) + NAME_FIELD_NUMBER;
        hash = (53 * hash) + getName().hashCode();
        hash = (37 * hash) + OP_FIELD_NUMBER;
        hash = (53 * hash) + getOp().hashCode();
        if (getInputCount() > 0) {
          hash = (37 * hash) + INPUT_FIELD_NUMBER;
          hash = (53 * hash) + getInputList().hashCode();
        }
        hash = (37 * hash) + DEVICE_FIELD_NUMBER;
        hash = (53 * hash) + getDevice().hashCode();
        if (!internalGetAttr().getMap().isEmpty()) {
          hash = (37 * hash) + ATTR_FIELD_NUMBER;
          hash = (53 * hash) + internalGetAttr().hashCode();
        }
        hash = (29 * hash) + unknownFields.hashCode();
        memoizedHashCode = hash;
        return hash;
      }
  
      public static com.tencent.angel.core.graph.NodeProto.NodeDef parseFrom(
          java.nio.ByteBuffer data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.core.graph.NodeProto.NodeDef parseFrom(
          java.nio.ByteBuffer data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static com.tencent.angel.core.graph.NodeProto.NodeDef parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.core.graph.NodeProto.NodeDef parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static com.tencent.angel.core.graph.NodeProto.NodeDef parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.core.graph.NodeProto.NodeDef parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static com.tencent.angel.core.graph.NodeProto.NodeDef parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseWithIOException(PARSER, input);
      }
      public static com.tencent.angel.core.graph.NodeProto.NodeDef 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 com.tencent.angel.core.graph.NodeProto.NodeDef parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseDelimitedWithIOException(PARSER, input);
      }
      public static com.tencent.angel.core.graph.NodeProto.NodeDef 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 com.tencent.angel.core.graph.NodeProto.NodeDef parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseWithIOException(PARSER, input);
      }
      public static com.tencent.angel.core.graph.NodeProto.NodeDef 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(com.tencent.angel.core.graph.NodeProto.NodeDef prototype) {
        return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() {
        return this == DEFAULT_INSTANCE
            ? new Builder() : new Builder().mergeFrom(this);
      }
  
      @java.lang.Override
      protected Builder newBuilderForType(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        Builder builder = new Builder(parent);
        return builder;
      }
      /**
       * Protobuf type {@code angel.NodeDef}
       */
      public static final class Builder extends
          com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
          // @@protoc_insertion_point(builder_implements:angel.NodeDef)
          com.tencent.angel.core.graph.NodeProto.NodeDefOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor
            getDescriptor() {
          return com.tencent.angel.core.graph.NodeProto.internal_static_angel_NodeDef_descriptor;
        }
  
        @SuppressWarnings({"rawtypes"})
        protected com.google.protobuf.MapField internalGetMapField(
            int number) {
          switch (number) {
            case 5:
              return internalGetAttr();
            default:
              throw new RuntimeException(
                  "Invalid map field number: " + number);
          }
        }
        @SuppressWarnings({"rawtypes"})
        protected com.google.protobuf.MapField internalGetMutableMapField(
            int number) {
          switch (number) {
            case 5:
              return internalGetMutableAttr();
            default:
              throw new RuntimeException(
                  "Invalid map field number: " + number);
          }
        }
        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return com.tencent.angel.core.graph.NodeProto.internal_static_angel_NodeDef_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.tencent.angel.core.graph.NodeProto.NodeDef.class, com.tencent.angel.core.graph.NodeProto.NodeDef.Builder.class);
        }
  
        // Construct using com.tencent.angel.core.graph.NodeProto.NodeDef.newBuilder()
        private Builder() {
          maybeForceBuilderInitialization();
        }
  
        private Builder(
            com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
          super(parent);
          maybeForceBuilderInitialization();
        }
        private void maybeForceBuilderInitialization() {
          if (com.google.protobuf.GeneratedMessageV3
                  .alwaysUseFieldBuilders) {
          }
        }
        public Builder clear() {
          super.clear();
          name_ = "";
  
          op_ = "";
  
          input_ = com.google.protobuf.LazyStringArrayList.EMPTY;
          bitField0_ = (bitField0_ & ~0x00000004);
          device_ = "";
  
          internalGetMutableAttr().clear();
          return this;
        }
  
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return com.tencent.angel.core.graph.NodeProto.internal_static_angel_NodeDef_descriptor;
        }
  
        public com.tencent.angel.core.graph.NodeProto.NodeDef getDefaultInstanceForType() {
          return com.tencent.angel.core.graph.NodeProto.NodeDef.getDefaultInstance();
        }
  
        public com.tencent.angel.core.graph.NodeProto.NodeDef build() {
          com.tencent.angel.core.graph.NodeProto.NodeDef result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }
  
        public com.tencent.angel.core.graph.NodeProto.NodeDef buildPartial() {
          com.tencent.angel.core.graph.NodeProto.NodeDef result = new com.tencent.angel.core.graph.NodeProto.NodeDef(this);
          int from_bitField0_ = bitField0_;
          int to_bitField0_ = 0;
          result.name_ = name_;
          result.op_ = op_;
          if (((bitField0_ & 0x00000004) == 0x00000004)) {
            input_ = input_.getUnmodifiableView();
            bitField0_ = (bitField0_ & ~0x00000004);
          }
          result.input_ = input_;
          result.device_ = device_;
          result.attr_ = internalGetAttr();
          result.attr_.makeImmutable();
          result.bitField0_ = to_bitField0_;
          onBuilt();
          return result;
        }
  
        public Builder clone() {
          return (Builder) super.clone();
        }
        public Builder setField(
            com.google.protobuf.Descriptors.FieldDescriptor field,
            java.lang.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, java.lang.Object value) {
          return (Builder) super.setRepeatedField(field, index, value);
        }
        public Builder addRepeatedField(
            com.google.protobuf.Descriptors.FieldDescriptor field,
            java.lang.Object value) {
          return (Builder) super.addRepeatedField(field, value);
        }
        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other instanceof com.tencent.angel.core.graph.NodeProto.NodeDef) {
            return mergeFrom((com.tencent.angel.core.graph.NodeProto.NodeDef)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
  
        public Builder mergeFrom(com.tencent.angel.core.graph.NodeProto.NodeDef other) {
          if (other == com.tencent.angel.core.graph.NodeProto.NodeDef.getDefaultInstance()) return this;
          if (!other.getName().isEmpty()) {
            name_ = other.name_;
            onChanged();
          }
          if (!other.getOp().isEmpty()) {
            op_ = other.op_;
            onChanged();
          }
          if (!other.input_.isEmpty()) {
            if (input_.isEmpty()) {
              input_ = other.input_;
              bitField0_ = (bitField0_ & ~0x00000004);
            } else {
              ensureInputIsMutable();
              input_.addAll(other.input_);
            }
            onChanged();
          }
          if (!other.getDevice().isEmpty()) {
            device_ = other.device_;
            onChanged();
          }
          internalGetMutableAttr().mergeFrom(
              other.internalGetAttr());
          this.mergeUnknownFields(other.unknownFields);
          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 {
          com.tencent.angel.core.graph.NodeProto.NodeDef parsedMessage = null;
          try {
            parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            parsedMessage = (com.tencent.angel.core.graph.NodeProto.NodeDef) e.getUnfinishedMessage();
            throw e.unwrapIOException();
          } finally {
            if (parsedMessage != null) {
              mergeFrom(parsedMessage);
            }
          }
          return this;
        }
        private int bitField0_;
  
        private java.lang.Object name_ = "";
        /**
         * <pre>
         * The name given to this operator. Used for naming inputs,
         * logging, visualization, etc.  Unique within a single GraphDef.
         * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*".
         * </pre>
         *
         * <code>string name = 1;</code>
         */
        public java.lang.String getName() {
          java.lang.Object ref = name_;
          if (!(ref instanceof java.lang.String)) {
            com.google.protobuf.ByteString bs =
                (com.google.protobuf.ByteString) ref;
            java.lang.String s = bs.toStringUtf8();
            name_ = s;
            return s;
          } else {
            return (java.lang.String) ref;
          }
        }
        /**
         * <pre>
         * The name given to this operator. Used for naming inputs,
         * logging, visualization, etc.  Unique within a single GraphDef.
         * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*".
         * </pre>
         *
         * <code>string name = 1;</code>
         */
        public com.google.protobuf.ByteString
            getNameBytes() {
          java.lang.Object ref = name_;
          if (ref instanceof String) {
            com.google.protobuf.ByteString b = 
                com.google.protobuf.ByteString.copyFromUtf8(
                    (java.lang.String) ref);
            name_ = b;
            return b;
          } else {
            return (com.google.protobuf.ByteString) ref;
          }
        }
        /**
         * <pre>
         * The name given to this operator. Used for naming inputs,
         * logging, visualization, etc.  Unique within a single GraphDef.
         * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*".
         * </pre>
         *
         * <code>string name = 1;</code>
         */
        public Builder setName(
            java.lang.String value) {
          if (value == null) {
      throw new NullPointerException();
    }
    
          name_ = value;
          onChanged();
          return this;
        }
        /**
         * <pre>
         * The name given to this operator. Used for naming inputs,
         * logging, visualization, etc.  Unique within a single GraphDef.
         * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*".
         * </pre>
         *
         * <code>string name = 1;</code>
         */
        public Builder clearName() {
          
          name_ = getDefaultInstance().getName();
          onChanged();
          return this;
        }
        /**
         * <pre>
         * The name given to this operator. Used for naming inputs,
         * logging, visualization, etc.  Unique within a single GraphDef.
         * Must match the regexp "[A-Za-z0-9.][A-Za-z0-9_./]*".
         * </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 java.lang.Object op_ = "";
        /**
         * <pre>
         * The operation name.  There may be custom parameters in attrs.
         * Op names starting with an underscore are reserved for internal use.
         * </pre>
         *
         * <code>string op = 2;</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>
         * The operation name.  There may be custom parameters in attrs.
         * Op names starting with an underscore are reserved for internal use.
         * </pre>
         *
         * <code>string op = 2;</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>
         * The operation name.  There may be custom parameters in attrs.
         * Op names starting with an underscore are reserved for internal use.
         * </pre>
         *
         * <code>string op = 2;</code>
         */
        public Builder setOp(
            java.lang.String value) {
          if (value == null) {
      throw new NullPointerException();
    }
    
          op_ = value;
          onChanged();
          return this;
        }
        /**
         * <pre>
         * The operation name.  There may be custom parameters in attrs.
         * Op names starting with an underscore are reserved for internal use.
         * </pre>
         *
         * <code>string op = 2;</code>
         */
        public Builder clearOp() {
          
          op_ = getDefaultInstance().getOp();
          onChanged();
          return this;
        }
        /**
         * <pre>
         * The operation name.  There may be custom parameters in attrs.
         * Op names starting with an underscore are reserved for internal use.
         * </pre>
         *
         * <code>string op = 2;</code>
         */
        public Builder setOpBytes(
            com.google.protobuf.ByteString value) {
          if (value == null) {
      throw new NullPointerException();
    }
    checkByteStringIsUtf8(value);
          
          op_ = value;
          onChanged();
          return this;
        }
  
        private com.google.protobuf.LazyStringList input_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        private void ensureInputIsMutable() {
          if (!((bitField0_ & 0x00000004) == 0x00000004)) {
            input_ = new com.google.protobuf.LazyStringArrayList(input_);
            bitField0_ |= 0x00000004;
           }
        }
        /**
         * <pre>
         * Each input is "node:src_output" with "node" being a string name and
         * "src_output" indicating which output tensor to use from "node". If
         * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
         * may optionally be followed by control inputs that have the format
         * "^node".
         * </pre>
         *
         * <code>repeated string input = 3;</code>
         */
        public com.google.protobuf.ProtocolStringList
            getInputList() {
          return input_.getUnmodifiableView();
        }
        /**
         * <pre>
         * Each input is "node:src_output" with "node" being a string name and
         * "src_output" indicating which output tensor to use from "node". If
         * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
         * may optionally be followed by control inputs that have the format
         * "^node".
         * </pre>
         *
         * <code>repeated string input = 3;</code>
         */
        public int getInputCount() {
          return input_.size();
        }
        /**
         * <pre>
         * Each input is "node:src_output" with "node" being a string name and
         * "src_output" indicating which output tensor to use from "node". If
         * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
         * may optionally be followed by control inputs that have the format
         * "^node".
         * </pre>
         *
         * <code>repeated string input = 3;</code>
         */
        public java.lang.String getInput(int index) {
          return input_.get(index);
        }
        /**
         * <pre>
         * Each input is "node:src_output" with "node" being a string name and
         * "src_output" indicating which output tensor to use from "node". If
         * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
         * may optionally be followed by control inputs that have the format
         * "^node".
         * </pre>
         *
         * <code>repeated string input = 3;</code>
         */
        public com.google.protobuf.ByteString
            getInputBytes(int index) {
          return input_.getByteString(index);
        }
        /**
         * <pre>
         * Each input is "node:src_output" with "node" being a string name and
         * "src_output" indicating which output tensor to use from "node". If
         * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
         * may optionally be followed by control inputs that have the format
         * "^node".
         * </pre>
         *
         * <code>repeated string input = 3;</code>
         */
        public Builder setInput(
            int index, java.lang.String value) {
          if (value == null) {
      throw new NullPointerException();
    }
    ensureInputIsMutable();
          input_.set(index, value);
          onChanged();
          return this;
        }
        /**
         * <pre>
         * Each input is "node:src_output" with "node" being a string name and
         * "src_output" indicating which output tensor to use from "node". If
         * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
         * may optionally be followed by control inputs that have the format
         * "^node".
         * </pre>
         *
         * <code>repeated string input = 3;</code>
         */
        public Builder addInput(
            java.lang.String value) {
          if (value == null) {
      throw new NullPointerException();
    }
    ensureInputIsMutable();
          input_.add(value);
          onChanged();
          return this;
        }
        /**
         * <pre>
         * Each input is "node:src_output" with "node" being a string name and
         * "src_output" indicating which output tensor to use from "node". If
         * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
         * may optionally be followed by control inputs that have the format
         * "^node".
         * </pre>
         *
         * <code>repeated string input = 3;</code>
         */
        public Builder addAllInput(
            java.lang.Iterable<java.lang.String> values) {
          ensureInputIsMutable();
          com.google.protobuf.AbstractMessageLite.Builder.addAll(
              values, input_);
          onChanged();
          return this;
        }
        /**
         * <pre>
         * Each input is "node:src_output" with "node" being a string name and
         * "src_output" indicating which output tensor to use from "node". If
         * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
         * may optionally be followed by control inputs that have the format
         * "^node".
         * </pre>
         *
         * <code>repeated string input = 3;</code>
         */
        public Builder clearInput() {
          input_ = com.google.protobuf.LazyStringArrayList.EMPTY;
          bitField0_ = (bitField0_ & ~0x00000004);
          onChanged();
          return this;
        }
        /**
         * <pre>
         * Each input is "node:src_output" with "node" being a string name and
         * "src_output" indicating which output tensor to use from "node". If
         * "src_output" is 0 the ":0" suffix can be omitted.  Regular inputs
         * may optionally be followed by control inputs that have the format
         * "^node".
         * </pre>
         *
         * <code>repeated string input = 3;</code>
         */
        public Builder addInputBytes(
            com.google.protobuf.ByteString value) {
          if (value == null) {
      throw new NullPointerException();
    }
    checkByteStringIsUtf8(value);
          ensureInputIsMutable();
          input_.add(value);
          onChanged();
          return this;
        }
  
        private java.lang.Object device_ = "";
        /**
         * <pre>
         * A (possibly partial) specification for the device on which this
         * node should be placed.
         * The expected syntax for this string is as follows:
         * DEVICE_SPEC ::= PARTIAL_SPEC
         * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
         * CONSTRAINT ::= ("job:" JOB_NAME)
         *              | ("replica:" [1-9][0-9]*)
         *              | ("task:" [1-9][0-9]*)
         *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
         * Valid values for this string include:
         * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
         * * "/job:worker/device:GPU:3"                   (partial specification)
         * * ""                                    (no specification)
         * If the constraints do not resolve to a single device (or if this
         * field is empty or not present), the runtime will attempt to
         * choose a device automatically.
         * </pre>
         *
         * <code>string device = 4;</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>
         * A (possibly partial) specification for the device on which this
         * node should be placed.
         * The expected syntax for this string is as follows:
         * DEVICE_SPEC ::= PARTIAL_SPEC
         * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
         * CONSTRAINT ::= ("job:" JOB_NAME)
         *              | ("replica:" [1-9][0-9]*)
         *              | ("task:" [1-9][0-9]*)
         *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
         * Valid values for this string include:
         * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
         * * "/job:worker/device:GPU:3"                   (partial specification)
         * * ""                                    (no specification)
         * If the constraints do not resolve to a single device (or if this
         * field is empty or not present), the runtime will attempt to
         * choose a device automatically.
         * </pre>
         *
         * <code>string device = 4;</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>
         * A (possibly partial) specification for the device on which this
         * node should be placed.
         * The expected syntax for this string is as follows:
         * DEVICE_SPEC ::= PARTIAL_SPEC
         * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
         * CONSTRAINT ::= ("job:" JOB_NAME)
         *              | ("replica:" [1-9][0-9]*)
         *              | ("task:" [1-9][0-9]*)
         *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
         * Valid values for this string include:
         * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
         * * "/job:worker/device:GPU:3"                   (partial specification)
         * * ""                                    (no specification)
         * If the constraints do not resolve to a single device (or if this
         * field is empty or not present), the runtime will attempt to
         * choose a device automatically.
         * </pre>
         *
         * <code>string device = 4;</code>
         */
        public Builder setDevice(
            java.lang.String value) {
          if (value == null) {
      throw new NullPointerException();
    }
    
          device_ = value;
          onChanged();
          return this;
        }
        /**
         * <pre>
         * A (possibly partial) specification for the device on which this
         * node should be placed.
         * The expected syntax for this string is as follows:
         * DEVICE_SPEC ::= PARTIAL_SPEC
         * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
         * CONSTRAINT ::= ("job:" JOB_NAME)
         *              | ("replica:" [1-9][0-9]*)
         *              | ("task:" [1-9][0-9]*)
         *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
         * Valid values for this string include:
         * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
         * * "/job:worker/device:GPU:3"                   (partial specification)
         * * ""                                    (no specification)
         * If the constraints do not resolve to a single device (or if this
         * field is empty or not present), the runtime will attempt to
         * choose a device automatically.
         * </pre>
         *
         * <code>string device = 4;</code>
         */
        public Builder clearDevice() {
          
          device_ = getDefaultInstance().getDevice();
          onChanged();
          return this;
        }
        /**
         * <pre>
         * A (possibly partial) specification for the device on which this
         * node should be placed.
         * The expected syntax for this string is as follows:
         * DEVICE_SPEC ::= PARTIAL_SPEC
         * PARTIAL_SPEC ::= ("/" CONSTRAINT) *
         * CONSTRAINT ::= ("job:" JOB_NAME)
         *              | ("replica:" [1-9][0-9]*)
         *              | ("task:" [1-9][0-9]*)
         *              | ("device:" [A-Za-z]* ":" ([1-9][0-9]* | "*") )
         * Valid values for this string include:
         * * "/job:worker/replica:0/task:1/device:GPU:3"  (full specification)
         * * "/job:worker/device:GPU:3"                   (partial specification)
         * * ""                                    (no specification)
         * If the constraints do not resolve to a single device (or if this
         * field is empty or not present), the runtime will attempt to
         * choose a device automatically.
         * </pre>
         *
         * <code>string device = 4;</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.MapField<
            java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> attr_;
        private com.google.protobuf.MapField<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue>
        internalGetAttr() {
          if (attr_ == null) {
            return com.google.protobuf.MapField.emptyMapField(
                AttrDefaultEntryHolder.defaultEntry);
          }
          return attr_;
        }
        private com.google.protobuf.MapField<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue>
        internalGetMutableAttr() {
          onChanged();;
          if (attr_ == null) {
            attr_ = com.google.protobuf.MapField.newMapField(
                AttrDefaultEntryHolder.defaultEntry);
          }
          if (!attr_.isMutable()) {
            attr_ = attr_.copy();
          }
          return attr_;
        }
  
        public int getAttrCount() {
          return internalGetAttr().getMap().size();
        }
        /**
         * <pre>
         * Operation-specific graph-construction-time configuration.
         * Note that this should include all attrs defined in the
         * corresponding OpDef, including those with a value matching
         * the default -- this allows the default to change and makes
         * NodeDefs easier to interpret on their own.  However, if
         * an attr with a default is not specified in this list, the
         * default will be used.
         * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
         * one of the names from the corresponding OpDef's attr field).
         * The values must have a type matching the corresponding OpDef
         * attr's type field.
         * TODO(josh11b): Add some examples here showing best practices.
         * </pre>
         *
         * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
         */
  
        public boolean containsAttr(
            java.lang.String key) {
          if (key == null) { throw new java.lang.NullPointerException(); }
          return internalGetAttr().getMap().containsKey(key);
        }
        /**
         * Use {@link #getAttrMap()} instead.
         */
        @java.lang.Deprecated
        public java.util.Map<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> getAttr() {
          return getAttrMap();
        }
        /**
         * <pre>
         * Operation-specific graph-construction-time configuration.
         * Note that this should include all attrs defined in the
         * corresponding OpDef, including those with a value matching
         * the default -- this allows the default to change and makes
         * NodeDefs easier to interpret on their own.  However, if
         * an attr with a default is not specified in this list, the
         * default will be used.
         * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
         * one of the names from the corresponding OpDef's attr field).
         * The values must have a type matching the corresponding OpDef
         * attr's type field.
         * TODO(josh11b): Add some examples here showing best practices.
         * </pre>
         *
         * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
         */
  
        public java.util.Map<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> getAttrMap() {
          return internalGetAttr().getMap();
        }
        /**
         * <pre>
         * Operation-specific graph-construction-time configuration.
         * Note that this should include all attrs defined in the
         * corresponding OpDef, including those with a value matching
         * the default -- this allows the default to change and makes
         * NodeDefs easier to interpret on their own.  However, if
         * an attr with a default is not specified in this list, the
         * default will be used.
         * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
         * one of the names from the corresponding OpDef's attr field).
         * The values must have a type matching the corresponding OpDef
         * attr's type field.
         * TODO(josh11b): Add some examples here showing best practices.
         * </pre>
         *
         * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
         */
  
        public com.tencent.angel.core.graph.AttrValueProtos.AttrValue getAttrOrDefault(
            java.lang.String key,
            com.tencent.angel.core.graph.AttrValueProtos.AttrValue defaultValue) {
          if (key == null) { throw new java.lang.NullPointerException(); }
          java.util.Map<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> map =
              internalGetAttr().getMap();
          return map.containsKey(key) ? map.get(key) : defaultValue;
        }
        /**
         * <pre>
         * Operation-specific graph-construction-time configuration.
         * Note that this should include all attrs defined in the
         * corresponding OpDef, including those with a value matching
         * the default -- this allows the default to change and makes
         * NodeDefs easier to interpret on their own.  However, if
         * an attr with a default is not specified in this list, the
         * default will be used.
         * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
         * one of the names from the corresponding OpDef's attr field).
         * The values must have a type matching the corresponding OpDef
         * attr's type field.
         * TODO(josh11b): Add some examples here showing best practices.
         * </pre>
         *
         * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
         */
  
        public com.tencent.angel.core.graph.AttrValueProtos.AttrValue getAttrOrThrow(
            java.lang.String key) {
          if (key == null) { throw new java.lang.NullPointerException(); }
          java.util.Map<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> map =
              internalGetAttr().getMap();
          if (!map.containsKey(key)) {
            throw new java.lang.IllegalArgumentException();
          }
          return map.get(key);
        }
  
        public Builder clearAttr() {
          internalGetMutableAttr().getMutableMap()
              .clear();
          return this;
        }
        /**
         * <pre>
         * Operation-specific graph-construction-time configuration.
         * Note that this should include all attrs defined in the
         * corresponding OpDef, including those with a value matching
         * the default -- this allows the default to change and makes
         * NodeDefs easier to interpret on their own.  However, if
         * an attr with a default is not specified in this list, the
         * default will be used.
         * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
         * one of the names from the corresponding OpDef's attr field).
         * The values must have a type matching the corresponding OpDef
         * attr's type field.
         * TODO(josh11b): Add some examples here showing best practices.
         * </pre>
         *
         * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
         */
  
        public Builder removeAttr(
            java.lang.String key) {
          if (key == null) { throw new java.lang.NullPointerException(); }
          internalGetMutableAttr().getMutableMap()
              .remove(key);
          return this;
        }
        /**
         * Use alternate mutation accessors instead.
         */
        @java.lang.Deprecated
        public java.util.Map<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue>
        getMutableAttr() {
          return internalGetMutableAttr().getMutableMap();
        }
        /**
         * <pre>
         * Operation-specific graph-construction-time configuration.
         * Note that this should include all attrs defined in the
         * corresponding OpDef, including those with a value matching
         * the default -- this allows the default to change and makes
         * NodeDefs easier to interpret on their own.  However, if
         * an attr with a default is not specified in this list, the
         * default will be used.
         * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
         * one of the names from the corresponding OpDef's attr field).
         * The values must have a type matching the corresponding OpDef
         * attr's type field.
         * TODO(josh11b): Add some examples here showing best practices.
         * </pre>
         *
         * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
         */
        public Builder putAttr(
            java.lang.String key,
            com.tencent.angel.core.graph.AttrValueProtos.AttrValue value) {
          if (key == null) { throw new java.lang.NullPointerException(); }
          if (value == null) { throw new java.lang.NullPointerException(); }
          internalGetMutableAttr().getMutableMap()
              .put(key, value);
          return this;
        }
        /**
         * <pre>
         * Operation-specific graph-construction-time configuration.
         * Note that this should include all attrs defined in the
         * corresponding OpDef, including those with a value matching
         * the default -- this allows the default to change and makes
         * NodeDefs easier to interpret on their own.  However, if
         * an attr with a default is not specified in this list, the
         * default will be used.
         * The "names" (keys) must match the regexp "[a-z][a-z0-9_]+" (and
         * one of the names from the corresponding OpDef's attr field).
         * The values must have a type matching the corresponding OpDef
         * attr's type field.
         * TODO(josh11b): Add some examples here showing best practices.
         * </pre>
         *
         * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
         */
  
        public Builder putAllAttr(
            java.util.Map<java.lang.String, com.tencent.angel.core.graph.AttrValueProtos.AttrValue> values) {
          internalGetMutableAttr().getMutableMap()
              .putAll(values);
          return this;
        }
        public final Builder setUnknownFields(
            final com.google.protobuf.UnknownFieldSet unknownFields) {
          return super.setUnknownFieldsProto3(unknownFields);
        }
  
        public final Builder mergeUnknownFields(
            final com.google.protobuf.UnknownFieldSet unknownFields) {
          return super.mergeUnknownFields(unknownFields);
        }
  
  
        // @@protoc_insertion_point(builder_scope:angel.NodeDef)
      }
  
      // @@protoc_insertion_point(class_scope:angel.NodeDef)
      private static final com.tencent.angel.core.graph.NodeProto.NodeDef DEFAULT_INSTANCE;
      static {
        DEFAULT_INSTANCE = new com.tencent.angel.core.graph.NodeProto.NodeDef();
      }
  
      public static com.tencent.angel.core.graph.NodeProto.NodeDef getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }
  
      private static final com.google.protobuf.Parser<NodeDef>
          PARSER = new com.google.protobuf.AbstractParser<NodeDef>() {
        public NodeDef parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new NodeDef(input, extensionRegistry);
        }
      };
  
      public static com.google.protobuf.Parser<NodeDef> parser() {
        return PARSER;
      }
  
      @java.lang.Override
      public com.google.protobuf.Parser<NodeDef> getParserForType() {
        return PARSER;
      }
  
      public com.tencent.angel.core.graph.NodeProto.NodeDef getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }
  
    }
  
    private static final com.google.protobuf.Descriptors.Descriptor
      internal_static_angel_NodeDef_descriptor;
    private static final 
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internal_static_angel_NodeDef_fieldAccessorTable;
    private static final com.google.protobuf.Descriptors.Descriptor
      internal_static_angel_NodeDef_AttrEntry_descriptor;
    private static final 
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internal_static_angel_NodeDef_AttrEntry_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\031core/graph/node_def.proto\022\005angel\032\033core" +
        "/graph/attr_value.proto\"\251\001\n\007NodeDef\022\014\n\004n" +
        "ame\030\001 \001(\t\022\n\n\002op\030\002 \001(\t\022\r\n\005input\030\003 \003(\t\022\016\n\006" +
        "device\030\004 \001(\t\022&\n\004attr\030\005 \003(\0132\030.angel.NodeD" +
        "ef.AttrEntry\032=\n\tAttrEntry\022\013\n\003key\030\001 \001(\t\022\037" +
        "\n\005value\030\002 \001(\0132\020.angel.AttrValue:\0028\001B+\n\034c" +
        "om.tencent.angel.core.graphB\tNodeProtoP\000" +
        "b\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.tencent.angel.core.graph.AttrValueProtos.getDescriptor(),
          }, assigner);
      internal_static_angel_NodeDef_descriptor =
        getDescriptor().getMessageTypes().get(0);
      internal_static_angel_NodeDef_fieldAccessorTable = new
        com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
          internal_static_angel_NodeDef_descriptor,
          new java.lang.String[] { "Name", "Op", "Input", "Device", "Attr", });
      internal_static_angel_NodeDef_AttrEntry_descriptor =
        internal_static_angel_NodeDef_descriptor.getNestedTypes().get(0);
      internal_static_angel_NodeDef_AttrEntry_fieldAccessorTable = new
        com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
          internal_static_angel_NodeDef_AttrEntry_descriptor,
          new java.lang.String[] { "Key", "Value", });
      com.tencent.angel.core.graph.AttrValueProtos.getDescriptor();
    }
  
    // @@protoc_insertion_point(outer_class_scope)
  }
  