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/function.proto
  
  package com.tencent.angel.core.graph;
  
  public final class FunctionProtos {
    private FunctionProtos() {}
    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 FunctionDefLibraryOrBuilder extends
        // @@protoc_insertion_point(interface_extends:angel.FunctionDefLibrary)
        com.google.protobuf.MessageOrBuilder {
  
      /**
       * <code>repeated .angel.FunctionDef function = 1;</code>
       */
      java.util.List<com.tencent.angel.core.graph.FunctionProtos.FunctionDef> 
          getFunctionList();
      /**
       * <code>repeated .angel.FunctionDef function = 1;</code>
       */
      com.tencent.angel.core.graph.FunctionProtos.FunctionDef getFunction(int index);
      /**
       * <code>repeated .angel.FunctionDef function = 1;</code>
       */
      int getFunctionCount();
      /**
       * <code>repeated .angel.FunctionDef function = 1;</code>
       */
      java.util.List<? extends com.tencent.angel.core.graph.FunctionProtos.FunctionDefOrBuilder> 
          getFunctionOrBuilderList();
      /**
       * <code>repeated .angel.FunctionDef function = 1;</code>
       */
      com.tencent.angel.core.graph.FunctionProtos.FunctionDefOrBuilder getFunctionOrBuilder(
          int index);
  
      /**
       * <code>repeated .angel.GradientDef gradient = 2;</code>
       */
      java.util.List<com.tencent.angel.core.graph.FunctionProtos.GradientDef> 
          getGradientList();
      /**
       * <code>repeated .angel.GradientDef gradient = 2;</code>
       */
      com.tencent.angel.core.graph.FunctionProtos.GradientDef getGradient(int index);
      /**
       * <code>repeated .angel.GradientDef gradient = 2;</code>
       */
      int getGradientCount();
      /**
       * <code>repeated .angel.GradientDef gradient = 2;</code>
       */
      java.util.List<? extends com.tencent.angel.core.graph.FunctionProtos.GradientDefOrBuilder> 
          getGradientOrBuilderList();
      /**
       * <code>repeated .angel.GradientDef gradient = 2;</code>
       */
      com.tencent.angel.core.graph.FunctionProtos.GradientDefOrBuilder getGradientOrBuilder(
          int index);
    }
    /**
     * <pre>
     * A library is a set of named functions.
     * </pre>
     *
     * Protobuf type {@code angel.FunctionDefLibrary}
     */
    public  static final class FunctionDefLibrary extends
        com.google.protobuf.GeneratedMessageV3 implements
        // @@protoc_insertion_point(message_implements:angel.FunctionDefLibrary)
        FunctionDefLibraryOrBuilder {
    private static final long serialVersionUID = 0L;
      // Use FunctionDefLibrary.newBuilder() to construct.
      private FunctionDefLibrary(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
        super(builder);
      }
      private FunctionDefLibrary() {
        function_ = java.util.Collections.emptyList();
        gradient_ = java.util.Collections.emptyList();
      }
  
      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet
      getUnknownFields() {
        return this.unknownFields;
      }
      private FunctionDefLibrary(
          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: {
                if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
                  function_ = new java.util.ArrayList<com.tencent.angel.core.graph.FunctionProtos.FunctionDef>();
                  mutable_bitField0_ |= 0x00000001;
                }
                function_.add(
                    input.readMessage(com.tencent.angel.core.graph.FunctionProtos.FunctionDef.parser(), extensionRegistry));
                break;
              }
              case 18: {
                if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
                  gradient_ = new java.util.ArrayList<com.tencent.angel.core.graph.FunctionProtos.GradientDef>();
                  mutable_bitField0_ |= 0x00000002;
                }
                gradient_.add(
                    input.readMessage(com.tencent.angel.core.graph.FunctionProtos.GradientDef.parser(), extensionRegistry));
                break;
              }
            }
          }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.setUnfinishedMessage(this);
        } catch (java.io.IOException e) {
          throw new com.google.protobuf.InvalidProtocolBufferException(
              e).setUnfinishedMessage(this);
        } finally {
          if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
            function_ = java.util.Collections.unmodifiableList(function_);
          }
          if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
            gradient_ = java.util.Collections.unmodifiableList(gradient_);
          }
          this.unknownFields = unknownFields.build();
          makeExtensionsImmutable();
        }
      }
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_FunctionDefLibrary_descriptor;
      }
  
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_FunctionDefLibrary_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary.class, com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary.Builder.class);
      }
  
      public static final int FUNCTION_FIELD_NUMBER = 1;
      private java.util.List<com.tencent.angel.core.graph.FunctionProtos.FunctionDef> function_;
      /**
       * <code>repeated .angel.FunctionDef function = 1;</code>
       */
      public java.util.List<com.tencent.angel.core.graph.FunctionProtos.FunctionDef> getFunctionList() {
        return function_;
      }
      /**
       * <code>repeated .angel.FunctionDef function = 1;</code>
       */
      public java.util.List<? extends com.tencent.angel.core.graph.FunctionProtos.FunctionDefOrBuilder> 
          getFunctionOrBuilderList() {
        return function_;
      }
      /**
       * <code>repeated .angel.FunctionDef function = 1;</code>
       */
      public int getFunctionCount() {
        return function_.size();
      }
      /**
       * <code>repeated .angel.FunctionDef function = 1;</code>
       */
      public com.tencent.angel.core.graph.FunctionProtos.FunctionDef getFunction(int index) {
        return function_.get(index);
      }
      /**
       * <code>repeated .angel.FunctionDef function = 1;</code>
       */
      public com.tencent.angel.core.graph.FunctionProtos.FunctionDefOrBuilder getFunctionOrBuilder(
          int index) {
        return function_.get(index);
      }
  
      public static final int GRADIENT_FIELD_NUMBER = 2;
      private java.util.List<com.tencent.angel.core.graph.FunctionProtos.GradientDef> gradient_;
      /**
       * <code>repeated .angel.GradientDef gradient = 2;</code>
       */
      public java.util.List<com.tencent.angel.core.graph.FunctionProtos.GradientDef> getGradientList() {
        return gradient_;
      }
      /**
       * <code>repeated .angel.GradientDef gradient = 2;</code>
       */
      public java.util.List<? extends com.tencent.angel.core.graph.FunctionProtos.GradientDefOrBuilder> 
          getGradientOrBuilderList() {
        return gradient_;
      }
      /**
       * <code>repeated .angel.GradientDef gradient = 2;</code>
       */
      public int getGradientCount() {
        return gradient_.size();
      }
      /**
       * <code>repeated .angel.GradientDef gradient = 2;</code>
       */
      public com.tencent.angel.core.graph.FunctionProtos.GradientDef getGradient(int index) {
        return gradient_.get(index);
      }
      /**
       * <code>repeated .angel.GradientDef gradient = 2;</code>
       */
      public com.tencent.angel.core.graph.FunctionProtos.GradientDefOrBuilder getGradientOrBuilder(
          int index) {
        return gradient_.get(index);
      }
  
      private byte memoizedIsInitialized = -1;
      public final boolean isInitialized() {
        byte isInitialized = memoizedIsInitialized;
        if (isInitialized == 1) return true;
        if (isInitialized == 0) return false;
  
        memoizedIsInitialized = 1;
        return true;
      }
  
      public void writeTo(com.google.protobuf.CodedOutputStream output)
                          throws java.io.IOException {
        for (int i = 0; i < function_.size(); i++) {
          output.writeMessage(1, function_.get(i));
        }
        for (int i = 0; i < gradient_.size(); i++) {
          output.writeMessage(2, gradient_.get(i));
        }
        unknownFields.writeTo(output);
      }
  
      public int getSerializedSize() {
        int size = memoizedSize;
        if (size != -1) return size;
  
        size = 0;
        for (int i = 0; i < function_.size(); i++) {
          size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(1, function_.get(i));
        }
        for (int i = 0; i < gradient_.size(); i++) {
          size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(2, gradient_.get(i));
        }
        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.FunctionProtos.FunctionDefLibrary)) {
          return super.equals(obj);
        }
        com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary other = (com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary) obj;
  
        boolean result = true;
        result = result && getFunctionList()
            .equals(other.getFunctionList());
        result = result && getGradientList()
            .equals(other.getGradientList());
        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();
        if (getFunctionCount() > 0) {
          hash = (37 * hash) + FUNCTION_FIELD_NUMBER;
          hash = (53 * hash) + getFunctionList().hashCode();
        }
        if (getGradientCount() > 0) {
          hash = (37 * hash) + GRADIENT_FIELD_NUMBER;
          hash = (53 * hash) + getGradientList().hashCode();
        }
        hash = (29 * hash) + unknownFields.hashCode();
        memoizedHashCode = hash;
        return hash;
      }
  
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary parseFrom(
          java.nio.ByteBuffer data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary 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.FunctionProtos.FunctionDefLibrary parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary 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.FunctionProtos.FunctionDefLibrary parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary 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.FunctionProtos.FunctionDefLibrary parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseWithIOException(PARSER, input);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary 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.FunctionProtos.FunctionDefLibrary parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseDelimitedWithIOException(PARSER, input);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary 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.FunctionProtos.FunctionDefLibrary 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.FunctionProtos.FunctionDefLibrary 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.FunctionProtos.FunctionDefLibrary prototype) {
        return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() {
        return this == DEFAULT_INSTANCE
            ? new Builder() : new Builder().mergeFrom(this);
      }
  
      @java.lang.Override
      protected Builder newBuilderForType(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        Builder builder = new Builder(parent);
        return builder;
      }
      /**
       * <pre>
       * A library is a set of named functions.
       * </pre>
       *
       * Protobuf type {@code angel.FunctionDefLibrary}
       */
      public static final class Builder extends
          com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
          // @@protoc_insertion_point(builder_implements:angel.FunctionDefLibrary)
          com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibraryOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor
            getDescriptor() {
          return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_FunctionDefLibrary_descriptor;
        }
  
        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_FunctionDefLibrary_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary.class, com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary.Builder.class);
        }
  
        // Construct using com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary.newBuilder()
        private Builder() {
          maybeForceBuilderInitialization();
        }
  
        private Builder(
            com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
          super(parent);
          maybeForceBuilderInitialization();
        }
        private void maybeForceBuilderInitialization() {
          if (com.google.protobuf.GeneratedMessageV3
                  .alwaysUseFieldBuilders) {
            getFunctionFieldBuilder();
            getGradientFieldBuilder();
          }
        }
        public Builder clear() {
          super.clear();
          if (functionBuilder_ == null) {
            function_ = java.util.Collections.emptyList();
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            functionBuilder_.clear();
          }
          if (gradientBuilder_ == null) {
            gradient_ = java.util.Collections.emptyList();
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            gradientBuilder_.clear();
          }
          return this;
        }
  
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_FunctionDefLibrary_descriptor;
        }
  
        public com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary getDefaultInstanceForType() {
          return com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary.getDefaultInstance();
        }
  
        public com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary build() {
          com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }
  
        public com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary buildPartial() {
          com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary result = new com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary(this);
          int from_bitField0_ = bitField0_;
          if (functionBuilder_ == null) {
            if (((bitField0_ & 0x00000001) == 0x00000001)) {
              function_ = java.util.Collections.unmodifiableList(function_);
              bitField0_ = (bitField0_ & ~0x00000001);
            }
            result.function_ = function_;
          } else {
            result.function_ = functionBuilder_.build();
          }
          if (gradientBuilder_ == null) {
            if (((bitField0_ & 0x00000002) == 0x00000002)) {
              gradient_ = java.util.Collections.unmodifiableList(gradient_);
              bitField0_ = (bitField0_ & ~0x00000002);
            }
            result.gradient_ = gradient_;
          } else {
            result.gradient_ = gradientBuilder_.build();
          }
          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.FunctionProtos.FunctionDefLibrary) {
            return mergeFrom((com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
  
        public Builder mergeFrom(com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary other) {
          if (other == com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary.getDefaultInstance()) return this;
          if (functionBuilder_ == null) {
            if (!other.function_.isEmpty()) {
              if (function_.isEmpty()) {
                function_ = other.function_;
                bitField0_ = (bitField0_ & ~0x00000001);
              } else {
                ensureFunctionIsMutable();
                function_.addAll(other.function_);
              }
              onChanged();
            }
          } else {
            if (!other.function_.isEmpty()) {
              if (functionBuilder_.isEmpty()) {
                functionBuilder_.dispose();
                functionBuilder_ = null;
                function_ = other.function_;
                bitField0_ = (bitField0_ & ~0x00000001);
                functionBuilder_ = 
                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                     getFunctionFieldBuilder() : null;
              } else {
                functionBuilder_.addAllMessages(other.function_);
              }
            }
          }
          if (gradientBuilder_ == null) {
            if (!other.gradient_.isEmpty()) {
              if (gradient_.isEmpty()) {
                gradient_ = other.gradient_;
                bitField0_ = (bitField0_ & ~0x00000002);
              } else {
                ensureGradientIsMutable();
                gradient_.addAll(other.gradient_);
              }
              onChanged();
            }
          } else {
            if (!other.gradient_.isEmpty()) {
              if (gradientBuilder_.isEmpty()) {
                gradientBuilder_.dispose();
                gradientBuilder_ = null;
                gradient_ = other.gradient_;
                bitField0_ = (bitField0_ & ~0x00000002);
                gradientBuilder_ = 
                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                     getGradientFieldBuilder() : null;
              } else {
                gradientBuilder_.addAllMessages(other.gradient_);
              }
            }
          }
          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.FunctionProtos.FunctionDefLibrary parsedMessage = null;
          try {
            parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            parsedMessage = (com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary) e.getUnfinishedMessage();
            throw e.unwrapIOException();
          } finally {
            if (parsedMessage != null) {
              mergeFrom(parsedMessage);
            }
          }
          return this;
        }
        private int bitField0_;
  
        private java.util.List<com.tencent.angel.core.graph.FunctionProtos.FunctionDef> function_ =
          java.util.Collections.emptyList();
        private void ensureFunctionIsMutable() {
          if (!((bitField0_ & 0x00000001) == 0x00000001)) {
            function_ = new java.util.ArrayList<com.tencent.angel.core.graph.FunctionProtos.FunctionDef>(function_);
            bitField0_ |= 0x00000001;
           }
        }
  
        private com.google.protobuf.RepeatedFieldBuilderV3<
            com.tencent.angel.core.graph.FunctionProtos.FunctionDef, com.tencent.angel.core.graph.FunctionProtos.FunctionDef.Builder, com.tencent.angel.core.graph.FunctionProtos.FunctionDefOrBuilder> functionBuilder_;
  
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public java.util.List<com.tencent.angel.core.graph.FunctionProtos.FunctionDef> getFunctionList() {
          if (functionBuilder_ == null) {
            return java.util.Collections.unmodifiableList(function_);
          } else {
            return functionBuilder_.getMessageList();
          }
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public int getFunctionCount() {
          if (functionBuilder_ == null) {
            return function_.size();
          } else {
            return functionBuilder_.getCount();
          }
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public com.tencent.angel.core.graph.FunctionProtos.FunctionDef getFunction(int index) {
          if (functionBuilder_ == null) {
            return function_.get(index);
          } else {
            return functionBuilder_.getMessage(index);
          }
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public Builder setFunction(
            int index, com.tencent.angel.core.graph.FunctionProtos.FunctionDef value) {
          if (functionBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureFunctionIsMutable();
            function_.set(index, value);
            onChanged();
          } else {
            functionBuilder_.setMessage(index, value);
          }
          return this;
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public Builder setFunction(
            int index, com.tencent.angel.core.graph.FunctionProtos.FunctionDef.Builder builderForValue) {
          if (functionBuilder_ == null) {
            ensureFunctionIsMutable();
            function_.set(index, builderForValue.build());
            onChanged();
          } else {
            functionBuilder_.setMessage(index, builderForValue.build());
          }
          return this;
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public Builder addFunction(com.tencent.angel.core.graph.FunctionProtos.FunctionDef value) {
          if (functionBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureFunctionIsMutable();
            function_.add(value);
            onChanged();
          } else {
            functionBuilder_.addMessage(value);
          }
          return this;
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public Builder addFunction(
            int index, com.tencent.angel.core.graph.FunctionProtos.FunctionDef value) {
          if (functionBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureFunctionIsMutable();
            function_.add(index, value);
            onChanged();
          } else {
            functionBuilder_.addMessage(index, value);
          }
          return this;
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public Builder addFunction(
            com.tencent.angel.core.graph.FunctionProtos.FunctionDef.Builder builderForValue) {
          if (functionBuilder_ == null) {
            ensureFunctionIsMutable();
            function_.add(builderForValue.build());
            onChanged();
          } else {
            functionBuilder_.addMessage(builderForValue.build());
          }
          return this;
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public Builder addFunction(
            int index, com.tencent.angel.core.graph.FunctionProtos.FunctionDef.Builder builderForValue) {
          if (functionBuilder_ == null) {
            ensureFunctionIsMutable();
            function_.add(index, builderForValue.build());
            onChanged();
          } else {
            functionBuilder_.addMessage(index, builderForValue.build());
          }
          return this;
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public Builder addAllFunction(
            java.lang.Iterable<? extends com.tencent.angel.core.graph.FunctionProtos.FunctionDef> values) {
          if (functionBuilder_ == null) {
            ensureFunctionIsMutable();
            com.google.protobuf.AbstractMessageLite.Builder.addAll(
                values, function_);
            onChanged();
          } else {
            functionBuilder_.addAllMessages(values);
          }
          return this;
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public Builder clearFunction() {
          if (functionBuilder_ == null) {
            function_ = java.util.Collections.emptyList();
            bitField0_ = (bitField0_ & ~0x00000001);
            onChanged();
          } else {
            functionBuilder_.clear();
          }
          return this;
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public Builder removeFunction(int index) {
          if (functionBuilder_ == null) {
            ensureFunctionIsMutable();
            function_.remove(index);
            onChanged();
          } else {
            functionBuilder_.remove(index);
          }
          return this;
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public com.tencent.angel.core.graph.FunctionProtos.FunctionDef.Builder getFunctionBuilder(
            int index) {
          return getFunctionFieldBuilder().getBuilder(index);
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public com.tencent.angel.core.graph.FunctionProtos.FunctionDefOrBuilder getFunctionOrBuilder(
            int index) {
          if (functionBuilder_ == null) {
            return function_.get(index);  } else {
            return functionBuilder_.getMessageOrBuilder(index);
          }
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public java.util.List<? extends com.tencent.angel.core.graph.FunctionProtos.FunctionDefOrBuilder> 
             getFunctionOrBuilderList() {
          if (functionBuilder_ != null) {
            return functionBuilder_.getMessageOrBuilderList();
          } else {
            return java.util.Collections.unmodifiableList(function_);
          }
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public com.tencent.angel.core.graph.FunctionProtos.FunctionDef.Builder addFunctionBuilder() {
          return getFunctionFieldBuilder().addBuilder(
              com.tencent.angel.core.graph.FunctionProtos.FunctionDef.getDefaultInstance());
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public com.tencent.angel.core.graph.FunctionProtos.FunctionDef.Builder addFunctionBuilder(
            int index) {
          return getFunctionFieldBuilder().addBuilder(
              index, com.tencent.angel.core.graph.FunctionProtos.FunctionDef.getDefaultInstance());
        }
        /**
         * <code>repeated .angel.FunctionDef function = 1;</code>
         */
        public java.util.List<com.tencent.angel.core.graph.FunctionProtos.FunctionDef.Builder> 
             getFunctionBuilderList() {
          return getFunctionFieldBuilder().getBuilderList();
        }
        private com.google.protobuf.RepeatedFieldBuilderV3<
            com.tencent.angel.core.graph.FunctionProtos.FunctionDef, com.tencent.angel.core.graph.FunctionProtos.FunctionDef.Builder, com.tencent.angel.core.graph.FunctionProtos.FunctionDefOrBuilder> 
            getFunctionFieldBuilder() {
          if (functionBuilder_ == null) {
            functionBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
                com.tencent.angel.core.graph.FunctionProtos.FunctionDef, com.tencent.angel.core.graph.FunctionProtos.FunctionDef.Builder, com.tencent.angel.core.graph.FunctionProtos.FunctionDefOrBuilder>(
                    function_,
                    ((bitField0_ & 0x00000001) == 0x00000001),
                    getParentForChildren(),
                    isClean());
            function_ = null;
          }
          return functionBuilder_;
        }
  
        private java.util.List<com.tencent.angel.core.graph.FunctionProtos.GradientDef> gradient_ =
          java.util.Collections.emptyList();
        private void ensureGradientIsMutable() {
          if (!((bitField0_ & 0x00000002) == 0x00000002)) {
            gradient_ = new java.util.ArrayList<com.tencent.angel.core.graph.FunctionProtos.GradientDef>(gradient_);
            bitField0_ |= 0x00000002;
           }
        }
  
        private com.google.protobuf.RepeatedFieldBuilderV3<
            com.tencent.angel.core.graph.FunctionProtos.GradientDef, com.tencent.angel.core.graph.FunctionProtos.GradientDef.Builder, com.tencent.angel.core.graph.FunctionProtos.GradientDefOrBuilder> gradientBuilder_;
  
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public java.util.List<com.tencent.angel.core.graph.FunctionProtos.GradientDef> getGradientList() {
          if (gradientBuilder_ == null) {
            return java.util.Collections.unmodifiableList(gradient_);
          } else {
            return gradientBuilder_.getMessageList();
          }
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public int getGradientCount() {
          if (gradientBuilder_ == null) {
            return gradient_.size();
          } else {
            return gradientBuilder_.getCount();
          }
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public com.tencent.angel.core.graph.FunctionProtos.GradientDef getGradient(int index) {
          if (gradientBuilder_ == null) {
            return gradient_.get(index);
          } else {
            return gradientBuilder_.getMessage(index);
          }
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public Builder setGradient(
            int index, com.tencent.angel.core.graph.FunctionProtos.GradientDef value) {
          if (gradientBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureGradientIsMutable();
            gradient_.set(index, value);
            onChanged();
          } else {
            gradientBuilder_.setMessage(index, value);
          }
          return this;
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public Builder setGradient(
            int index, com.tencent.angel.core.graph.FunctionProtos.GradientDef.Builder builderForValue) {
          if (gradientBuilder_ == null) {
            ensureGradientIsMutable();
            gradient_.set(index, builderForValue.build());
            onChanged();
          } else {
            gradientBuilder_.setMessage(index, builderForValue.build());
          }
          return this;
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public Builder addGradient(com.tencent.angel.core.graph.FunctionProtos.GradientDef value) {
          if (gradientBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureGradientIsMutable();
            gradient_.add(value);
            onChanged();
          } else {
            gradientBuilder_.addMessage(value);
          }
          return this;
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public Builder addGradient(
            int index, com.tencent.angel.core.graph.FunctionProtos.GradientDef value) {
          if (gradientBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureGradientIsMutable();
            gradient_.add(index, value);
            onChanged();
          } else {
            gradientBuilder_.addMessage(index, value);
          }
          return this;
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public Builder addGradient(
            com.tencent.angel.core.graph.FunctionProtos.GradientDef.Builder builderForValue) {
          if (gradientBuilder_ == null) {
            ensureGradientIsMutable();
            gradient_.add(builderForValue.build());
            onChanged();
          } else {
            gradientBuilder_.addMessage(builderForValue.build());
          }
          return this;
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public Builder addGradient(
            int index, com.tencent.angel.core.graph.FunctionProtos.GradientDef.Builder builderForValue) {
          if (gradientBuilder_ == null) {
            ensureGradientIsMutable();
            gradient_.add(index, builderForValue.build());
            onChanged();
          } else {
            gradientBuilder_.addMessage(index, builderForValue.build());
          }
          return this;
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public Builder addAllGradient(
            java.lang.Iterable<? extends com.tencent.angel.core.graph.FunctionProtos.GradientDef> values) {
          if (gradientBuilder_ == null) {
            ensureGradientIsMutable();
            com.google.protobuf.AbstractMessageLite.Builder.addAll(
                values, gradient_);
            onChanged();
          } else {
            gradientBuilder_.addAllMessages(values);
          }
          return this;
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public Builder clearGradient() {
          if (gradientBuilder_ == null) {
            gradient_ = java.util.Collections.emptyList();
            bitField0_ = (bitField0_ & ~0x00000002);
            onChanged();
          } else {
            gradientBuilder_.clear();
          }
          return this;
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public Builder removeGradient(int index) {
          if (gradientBuilder_ == null) {
            ensureGradientIsMutable();
            gradient_.remove(index);
            onChanged();
          } else {
            gradientBuilder_.remove(index);
          }
          return this;
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public com.tencent.angel.core.graph.FunctionProtos.GradientDef.Builder getGradientBuilder(
            int index) {
          return getGradientFieldBuilder().getBuilder(index);
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public com.tencent.angel.core.graph.FunctionProtos.GradientDefOrBuilder getGradientOrBuilder(
            int index) {
          if (gradientBuilder_ == null) {
            return gradient_.get(index);  } else {
            return gradientBuilder_.getMessageOrBuilder(index);
          }
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public java.util.List<? extends com.tencent.angel.core.graph.FunctionProtos.GradientDefOrBuilder> 
             getGradientOrBuilderList() {
          if (gradientBuilder_ != null) {
            return gradientBuilder_.getMessageOrBuilderList();
          } else {
            return java.util.Collections.unmodifiableList(gradient_);
          }
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public com.tencent.angel.core.graph.FunctionProtos.GradientDef.Builder addGradientBuilder() {
          return getGradientFieldBuilder().addBuilder(
              com.tencent.angel.core.graph.FunctionProtos.GradientDef.getDefaultInstance());
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public com.tencent.angel.core.graph.FunctionProtos.GradientDef.Builder addGradientBuilder(
            int index) {
          return getGradientFieldBuilder().addBuilder(
              index, com.tencent.angel.core.graph.FunctionProtos.GradientDef.getDefaultInstance());
        }
        /**
         * <code>repeated .angel.GradientDef gradient = 2;</code>
         */
        public java.util.List<com.tencent.angel.core.graph.FunctionProtos.GradientDef.Builder> 
             getGradientBuilderList() {
          return getGradientFieldBuilder().getBuilderList();
        }
        private com.google.protobuf.RepeatedFieldBuilderV3<
            com.tencent.angel.core.graph.FunctionProtos.GradientDef, com.tencent.angel.core.graph.FunctionProtos.GradientDef.Builder, com.tencent.angel.core.graph.FunctionProtos.GradientDefOrBuilder> 
            getGradientFieldBuilder() {
          if (gradientBuilder_ == null) {
            gradientBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
                com.tencent.angel.core.graph.FunctionProtos.GradientDef, com.tencent.angel.core.graph.FunctionProtos.GradientDef.Builder, com.tencent.angel.core.graph.FunctionProtos.GradientDefOrBuilder>(
                    gradient_,
                    ((bitField0_ & 0x00000002) == 0x00000002),
                    getParentForChildren(),
                    isClean());
            gradient_ = null;
          }
          return gradientBuilder_;
        }
        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.FunctionDefLibrary)
      }
  
      // @@protoc_insertion_point(class_scope:angel.FunctionDefLibrary)
      private static final com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary DEFAULT_INSTANCE;
      static {
        DEFAULT_INSTANCE = new com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary();
      }
  
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }
  
      private static final com.google.protobuf.Parser<FunctionDefLibrary>
          PARSER = new com.google.protobuf.AbstractParser<FunctionDefLibrary>() {
        public FunctionDefLibrary parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new FunctionDefLibrary(input, extensionRegistry);
        }
      };
  
      public static com.google.protobuf.Parser<FunctionDefLibrary> parser() {
        return PARSER;
      }
  
      @java.lang.Override
      public com.google.protobuf.Parser<FunctionDefLibrary> getParserForType() {
        return PARSER;
      }
  
      public com.tencent.angel.core.graph.FunctionProtos.FunctionDefLibrary getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }
  
    }
  
    public interface FunctionDefOrBuilder extends
        // @@protoc_insertion_point(interface_extends:angel.FunctionDef)
        com.google.protobuf.MessageOrBuilder {
  
      /**
       * <pre>
       * The definition of the function's name, arguments, return values,
       * attrs etc.
       * </pre>
       *
       * <code>.angel.OpDef signature = 1;</code>
       */
      boolean hasSignature();
      /**
       * <pre>
       * The definition of the function's name, arguments, return values,
       * attrs etc.
       * </pre>
       *
       * <code>.angel.OpDef signature = 1;</code>
       */
      com.tencent.angel.core.graph.OpDefProtos.OpDef getSignature();
      /**
       * <pre>
       * The definition of the function's name, arguments, return values,
       * attrs etc.
       * </pre>
       *
       * <code>.angel.OpDef signature = 1;</code>
       */
      com.tencent.angel.core.graph.OpDefProtos.OpDefOrBuilder getSignatureOrBuilder();
  
      /**
       * <pre>
       * Attributes specific to this function definition.
       * </pre>
       *
       * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
       */
      int getAttrCount();
      /**
       * <pre>
       * Attributes specific to this function definition.
       * </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>
       * Attributes specific to this function definition.
       * </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>
       * Attributes specific to this function definition.
       * </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>
       * Attributes specific to this function definition.
       * </pre>
       *
       * <code>map&lt;string, .angel.AttrValue&gt; attr = 5;</code>
       */
  
      com.tencent.angel.core.graph.AttrValueProtos.AttrValue getAttrOrThrow(
          java.lang.String key);
  
      /**
       * <pre>
       * By convention, "op" in node_def is resolved by consulting with a
       * user-defined library first. If not resolved, "func" is assumed to
       * be a builtin op.
       * </pre>
       *
       * <code>repeated .angel.NodeDef node_def = 3;</code>
       */
      java.util.List<com.tencent.angel.core.graph.NodeProto.NodeDef> 
          getNodeDefList();
      /**
       * <pre>
       * By convention, "op" in node_def is resolved by consulting with a
       * user-defined library first. If not resolved, "func" is assumed to
       * be a builtin op.
       * </pre>
       *
       * <code>repeated .angel.NodeDef node_def = 3;</code>
       */
      com.tencent.angel.core.graph.NodeProto.NodeDef getNodeDef(int index);
      /**
       * <pre>
       * By convention, "op" in node_def is resolved by consulting with a
       * user-defined library first. If not resolved, "func" is assumed to
       * be a builtin op.
       * </pre>
       *
       * <code>repeated .angel.NodeDef node_def = 3;</code>
       */
      int getNodeDefCount();
      /**
       * <pre>
       * By convention, "op" in node_def is resolved by consulting with a
       * user-defined library first. If not resolved, "func" is assumed to
       * be a builtin op.
       * </pre>
       *
       * <code>repeated .angel.NodeDef node_def = 3;</code>
       */
      java.util.List<? extends com.tencent.angel.core.graph.NodeProto.NodeDefOrBuilder> 
          getNodeDefOrBuilderList();
      /**
       * <pre>
       * By convention, "op" in node_def is resolved by consulting with a
       * user-defined library first. If not resolved, "func" is assumed to
       * be a builtin op.
       * </pre>
       *
       * <code>repeated .angel.NodeDef node_def = 3;</code>
       */
      com.tencent.angel.core.graph.NodeProto.NodeDefOrBuilder getNodeDefOrBuilder(
          int index);
  
      /**
       * <pre>
       * A mapping from the output arg names from `signature` to the
       * outputs from `node_def` that should be returned by the function.
       * </pre>
       *
       * <code>map&lt;string, string&gt; ret = 4;</code>
       */
      int getRetCount();
      /**
       * <pre>
       * A mapping from the output arg names from `signature` to the
       * outputs from `node_def` that should be returned by the function.
       * </pre>
       *
       * <code>map&lt;string, string&gt; ret = 4;</code>
       */
      boolean containsRet(
          java.lang.String key);
      /**
       * Use {@link #getRetMap()} instead.
       */
      @java.lang.Deprecated
      java.util.Map<java.lang.String, java.lang.String>
      getRet();
      /**
       * <pre>
       * A mapping from the output arg names from `signature` to the
       * outputs from `node_def` that should be returned by the function.
       * </pre>
       *
       * <code>map&lt;string, string&gt; ret = 4;</code>
       */
      java.util.Map<java.lang.String, java.lang.String>
      getRetMap();
      /**
       * <pre>
       * A mapping from the output arg names from `signature` to the
       * outputs from `node_def` that should be returned by the function.
       * </pre>
       *
       * <code>map&lt;string, string&gt; ret = 4;</code>
       */
  
      java.lang.String getRetOrDefault(
          java.lang.String key,
          java.lang.String defaultValue);
      /**
       * <pre>
       * A mapping from the output arg names from `signature` to the
       * outputs from `node_def` that should be returned by the function.
       * </pre>
       *
       * <code>map&lt;string, string&gt; ret = 4;</code>
       */
  
      java.lang.String getRetOrThrow(
          java.lang.String key);
    }
    /**
     * <pre>
     * A function can be instantiated when the runtime can bind every attr
     * with a value. When a GraphDef has a call to a function, it must
     * have binding for every attr defined in the signature.
     * TODO(zhifengc):
     *   * device spec, etc.
     * </pre>
     *
     * Protobuf type {@code angel.FunctionDef}
     */
    public  static final class FunctionDef extends
        com.google.protobuf.GeneratedMessageV3 implements
        // @@protoc_insertion_point(message_implements:angel.FunctionDef)
        FunctionDefOrBuilder {
    private static final long serialVersionUID = 0L;
      // Use FunctionDef.newBuilder() to construct.
      private FunctionDef(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
        super(builder);
      }
      private FunctionDef() {
        nodeDef_ = java.util.Collections.emptyList();
      }
  
      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet
      getUnknownFields() {
        return this.unknownFields;
      }
      private FunctionDef(
          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: {
                com.tencent.angel.core.graph.OpDefProtos.OpDef.Builder subBuilder = null;
                if (signature_ != null) {
                  subBuilder = signature_.toBuilder();
                }
                signature_ = input.readMessage(com.tencent.angel.core.graph.OpDefProtos.OpDef.parser(), extensionRegistry);
                if (subBuilder != null) {
                  subBuilder.mergeFrom(signature_);
                  signature_ = subBuilder.buildPartial();
                }
  
                break;
              }
              case 26: {
                if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
                  nodeDef_ = new java.util.ArrayList<com.tencent.angel.core.graph.NodeProto.NodeDef>();
                  mutable_bitField0_ |= 0x00000004;
                }
                nodeDef_.add(
                    input.readMessage(com.tencent.angel.core.graph.NodeProto.NodeDef.parser(), extensionRegistry));
                break;
              }
              case 34: {
                if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
                  ret_ = com.google.protobuf.MapField.newMapField(
                      RetDefaultEntryHolder.defaultEntry);
                  mutable_bitField0_ |= 0x00000008;
                }
                com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
                ret__ = input.readMessage(
                    RetDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
                ret_.getMutableMap().put(
                    ret__.getKey(), ret__.getValue());
                break;
              }
              case 42: {
                if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
                  attr_ = com.google.protobuf.MapField.newMapField(
                      AttrDefaultEntryHolder.defaultEntry);
                  mutable_bitField0_ |= 0x00000002;
                }
                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)) {
            nodeDef_ = java.util.Collections.unmodifiableList(nodeDef_);
          }
          this.unknownFields = unknownFields.build();
          makeExtensionsImmutable();
        }
      }
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_FunctionDef_descriptor;
      }
  
      @SuppressWarnings({"rawtypes"})
      protected com.google.protobuf.MapField internalGetMapField(
          int number) {
        switch (number) {
          case 5:
            return internalGetAttr();
          case 4:
            return internalGetRet();
          default:
            throw new RuntimeException(
                "Invalid map field number: " + number);
        }
      }
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_FunctionDef_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.tencent.angel.core.graph.FunctionProtos.FunctionDef.class, com.tencent.angel.core.graph.FunctionProtos.FunctionDef.Builder.class);
      }
  
      private int bitField0_;
      public static final int SIGNATURE_FIELD_NUMBER = 1;
      private com.tencent.angel.core.graph.OpDefProtos.OpDef signature_;
      /**
       * <pre>
       * The definition of the function's name, arguments, return values,
       * attrs etc.
       * </pre>
       *
       * <code>.angel.OpDef signature = 1;</code>
       */
      public boolean hasSignature() {
        return signature_ != null;
      }
      /**
       * <pre>
       * The definition of the function's name, arguments, return values,
       * attrs etc.
       * </pre>
       *
       * <code>.angel.OpDef signature = 1;</code>
       */
      public com.tencent.angel.core.graph.OpDefProtos.OpDef getSignature() {
        return signature_ == null ? com.tencent.angel.core.graph.OpDefProtos.OpDef.getDefaultInstance() : signature_;
      }
      /**
       * <pre>
       * The definition of the function's name, arguments, return values,
       * attrs etc.
       * </pre>
       *
       * <code>.angel.OpDef signature = 1;</code>
       */
      public com.tencent.angel.core.graph.OpDefProtos.OpDefOrBuilder getSignatureOrBuilder() {
        return getSignature();
      }
  
      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.FunctionProtos.internal_static_angel_FunctionDef_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>
       * Attributes specific to this function definition.
       * </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>
       * Attributes specific to this function definition.
       * </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>
       * Attributes specific to this function definition.
       * </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>
       * Attributes specific to this function definition.
       * </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 static final int NODE_DEF_FIELD_NUMBER = 3;
      private java.util.List<com.tencent.angel.core.graph.NodeProto.NodeDef> nodeDef_;
      /**
       * <pre>
       * By convention, "op" in node_def is resolved by consulting with a
       * user-defined library first. If not resolved, "func" is assumed to
       * be a builtin op.
       * </pre>
       *
       * <code>repeated .angel.NodeDef node_def = 3;</code>
       */
      public java.util.List<com.tencent.angel.core.graph.NodeProto.NodeDef> getNodeDefList() {
        return nodeDef_;
      }
      /**
       * <pre>
       * By convention, "op" in node_def is resolved by consulting with a
       * user-defined library first. If not resolved, "func" is assumed to
       * be a builtin op.
       * </pre>
       *
       * <code>repeated .angel.NodeDef node_def = 3;</code>
       */
      public java.util.List<? extends com.tencent.angel.core.graph.NodeProto.NodeDefOrBuilder> 
          getNodeDefOrBuilderList() {
        return nodeDef_;
      }
      /**
       * <pre>
       * By convention, "op" in node_def is resolved by consulting with a
       * user-defined library first. If not resolved, "func" is assumed to
       * be a builtin op.
       * </pre>
       *
       * <code>repeated .angel.NodeDef node_def = 3;</code>
       */
      public int getNodeDefCount() {
        return nodeDef_.size();
      }
      /**
       * <pre>
       * By convention, "op" in node_def is resolved by consulting with a
       * user-defined library first. If not resolved, "func" is assumed to
       * be a builtin op.
       * </pre>
       *
       * <code>repeated .angel.NodeDef node_def = 3;</code>
       */
      public com.tencent.angel.core.graph.NodeProto.NodeDef getNodeDef(int index) {
        return nodeDef_.get(index);
      }
      /**
       * <pre>
       * By convention, "op" in node_def is resolved by consulting with a
       * user-defined library first. If not resolved, "func" is assumed to
       * be a builtin op.
       * </pre>
       *
       * <code>repeated .angel.NodeDef node_def = 3;</code>
       */
      public com.tencent.angel.core.graph.NodeProto.NodeDefOrBuilder getNodeDefOrBuilder(
          int index) {
        return nodeDef_.get(index);
      }
  
      public static final int RET_FIELD_NUMBER = 4;
      private static final class RetDefaultEntryHolder {
        static final com.google.protobuf.MapEntry<
            java.lang.String, java.lang.String> defaultEntry =
                com.google.protobuf.MapEntry
                .<java.lang.String, java.lang.String>newDefaultInstance(
                    com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_FunctionDef_RetEntry_descriptor, 
                    com.google.protobuf.WireFormat.FieldType.STRING,
                    "",
                    com.google.protobuf.WireFormat.FieldType.STRING,
                    "");
      }
      private com.google.protobuf.MapField<
          java.lang.String, java.lang.String> ret_;
      private com.google.protobuf.MapField<java.lang.String, java.lang.String>
      internalGetRet() {
        if (ret_ == null) {
          return com.google.protobuf.MapField.emptyMapField(
              RetDefaultEntryHolder.defaultEntry);
        }
        return ret_;
      }
  
      public int getRetCount() {
        return internalGetRet().getMap().size();
      }
      /**
       * <pre>
       * A mapping from the output arg names from `signature` to the
       * outputs from `node_def` that should be returned by the function.
       * </pre>
       *
       * <code>map&lt;string, string&gt; ret = 4;</code>
       */
  
      public boolean containsRet(
          java.lang.String key) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        return internalGetRet().getMap().containsKey(key);
      }
      /**
       * Use {@link #getRetMap()} instead.
       */
      @java.lang.Deprecated
      public java.util.Map<java.lang.String, java.lang.String> getRet() {
        return getRetMap();
      }
      /**
       * <pre>
       * A mapping from the output arg names from `signature` to the
       * outputs from `node_def` that should be returned by the function.
       * </pre>
       *
       * <code>map&lt;string, string&gt; ret = 4;</code>
       */
  
      public java.util.Map<java.lang.String, java.lang.String> getRetMap() {
        return internalGetRet().getMap();
      }
      /**
       * <pre>
       * A mapping from the output arg names from `signature` to the
       * outputs from `node_def` that should be returned by the function.
       * </pre>
       *
       * <code>map&lt;string, string&gt; ret = 4;</code>
       */
  
      public java.lang.String getRetOrDefault(
          java.lang.String key,
          java.lang.String defaultValue) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        java.util.Map<java.lang.String, java.lang.String> map =
            internalGetRet().getMap();
        return map.containsKey(key) ? map.get(key) : defaultValue;
      }
      /**
       * <pre>
       * A mapping from the output arg names from `signature` to the
       * outputs from `node_def` that should be returned by the function.
       * </pre>
       *
       * <code>map&lt;string, string&gt; ret = 4;</code>
       */
  
      public java.lang.String getRetOrThrow(
          java.lang.String key) {
        if (key == null) { throw new java.lang.NullPointerException(); }
        java.util.Map<java.lang.String, java.lang.String> map =
            internalGetRet().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 (signature_ != null) {
          output.writeMessage(1, getSignature());
        }
        for (int i = 0; i < nodeDef_.size(); i++) {
          output.writeMessage(3, nodeDef_.get(i));
        }
        com.google.protobuf.GeneratedMessageV3
          .serializeStringMapTo(
            output,
            internalGetRet(),
            RetDefaultEntryHolder.defaultEntry,
            4);
        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 (signature_ != null) {
          size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(1, getSignature());
        }
        for (int i = 0; i < nodeDef_.size(); i++) {
          size += com.google.protobuf.CodedOutputStream
            .computeMessageSize(3, nodeDef_.get(i));
        }
        for (java.util.Map.Entry<java.lang.String, java.lang.String> entry
             : internalGetRet().getMap().entrySet()) {
          com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
          ret__ = RetDefaultEntryHolder.defaultEntry.newBuilderForType()
              .setKey(entry.getKey())
              .setValue(entry.getValue())
              .build();
          size += com.google.protobuf.CodedOutputStream
              .computeMessageSize(4, ret__);
        }
        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.FunctionProtos.FunctionDef)) {
          return super.equals(obj);
        }
        com.tencent.angel.core.graph.FunctionProtos.FunctionDef other = (com.tencent.angel.core.graph.FunctionProtos.FunctionDef) obj;
  
        boolean result = true;
        result = result && (hasSignature() == other.hasSignature());
        if (hasSignature()) {
          result = result && getSignature()
              .equals(other.getSignature());
        }
        result = result && internalGetAttr().equals(
            other.internalGetAttr());
        result = result && getNodeDefList()
            .equals(other.getNodeDefList());
        result = result && internalGetRet().equals(
            other.internalGetRet());
        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();
        if (hasSignature()) {
          hash = (37 * hash) + SIGNATURE_FIELD_NUMBER;
          hash = (53 * hash) + getSignature().hashCode();
        }
        if (!internalGetAttr().getMap().isEmpty()) {
          hash = (37 * hash) + ATTR_FIELD_NUMBER;
          hash = (53 * hash) + internalGetAttr().hashCode();
        }
        if (getNodeDefCount() > 0) {
          hash = (37 * hash) + NODE_DEF_FIELD_NUMBER;
          hash = (53 * hash) + getNodeDefList().hashCode();
        }
        if (!internalGetRet().getMap().isEmpty()) {
          hash = (37 * hash) + RET_FIELD_NUMBER;
          hash = (53 * hash) + internalGetRet().hashCode();
        }
        hash = (29 * hash) + unknownFields.hashCode();
        memoizedHashCode = hash;
        return hash;
      }
  
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDef parseFrom(
          java.nio.ByteBuffer data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDef 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.FunctionProtos.FunctionDef parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDef 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.FunctionProtos.FunctionDef parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDef 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.FunctionProtos.FunctionDef parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseWithIOException(PARSER, input);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDef 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.FunctionProtos.FunctionDef parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseDelimitedWithIOException(PARSER, input);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDef 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.FunctionProtos.FunctionDef 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.FunctionProtos.FunctionDef 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.FunctionProtos.FunctionDef prototype) {
        return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() {
        return this == DEFAULT_INSTANCE
            ? new Builder() : new Builder().mergeFrom(this);
      }
  
      @java.lang.Override
      protected Builder newBuilderForType(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        Builder builder = new Builder(parent);
        return builder;
      }
      /**
       * <pre>
       * A function can be instantiated when the runtime can bind every attr
       * with a value. When a GraphDef has a call to a function, it must
       * have binding for every attr defined in the signature.
       * TODO(zhifengc):
       *   * device spec, etc.
       * </pre>
       *
       * Protobuf type {@code angel.FunctionDef}
       */
      public static final class Builder extends
          com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
          // @@protoc_insertion_point(builder_implements:angel.FunctionDef)
          com.tencent.angel.core.graph.FunctionProtos.FunctionDefOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor
            getDescriptor() {
          return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_FunctionDef_descriptor;
        }
  
        @SuppressWarnings({"rawtypes"})
        protected com.google.protobuf.MapField internalGetMapField(
            int number) {
          switch (number) {
            case 5:
              return internalGetAttr();
            case 4:
              return internalGetRet();
            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();
            case 4:
              return internalGetMutableRet();
            default:
              throw new RuntimeException(
                  "Invalid map field number: " + number);
          }
        }
        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_FunctionDef_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.tencent.angel.core.graph.FunctionProtos.FunctionDef.class, com.tencent.angel.core.graph.FunctionProtos.FunctionDef.Builder.class);
        }
  
        // Construct using com.tencent.angel.core.graph.FunctionProtos.FunctionDef.newBuilder()
        private Builder() {
          maybeForceBuilderInitialization();
        }
  
        private Builder(
            com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
          super(parent);
          maybeForceBuilderInitialization();
        }
        private void maybeForceBuilderInitialization() {
          if (com.google.protobuf.GeneratedMessageV3
                  .alwaysUseFieldBuilders) {
            getNodeDefFieldBuilder();
          }
        }
        public Builder clear() {
          super.clear();
          if (signatureBuilder_ == null) {
            signature_ = null;
          } else {
            signature_ = null;
            signatureBuilder_ = null;
          }
          internalGetMutableAttr().clear();
          if (nodeDefBuilder_ == null) {
            nodeDef_ = java.util.Collections.emptyList();
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            nodeDefBuilder_.clear();
          }
          internalGetMutableRet().clear();
          return this;
        }
  
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_FunctionDef_descriptor;
        }
  
        public com.tencent.angel.core.graph.FunctionProtos.FunctionDef getDefaultInstanceForType() {
          return com.tencent.angel.core.graph.FunctionProtos.FunctionDef.getDefaultInstance();
        }
  
        public com.tencent.angel.core.graph.FunctionProtos.FunctionDef build() {
          com.tencent.angel.core.graph.FunctionProtos.FunctionDef result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }
  
        public com.tencent.angel.core.graph.FunctionProtos.FunctionDef buildPartial() {
          com.tencent.angel.core.graph.FunctionProtos.FunctionDef result = new com.tencent.angel.core.graph.FunctionProtos.FunctionDef(this);
          int from_bitField0_ = bitField0_;
          int to_bitField0_ = 0;
          if (signatureBuilder_ == null) {
            result.signature_ = signature_;
          } else {
            result.signature_ = signatureBuilder_.build();
          }
          result.attr_ = internalGetAttr();
          result.attr_.makeImmutable();
          if (nodeDefBuilder_ == null) {
            if (((bitField0_ & 0x00000004) == 0x00000004)) {
              nodeDef_ = java.util.Collections.unmodifiableList(nodeDef_);
              bitField0_ = (bitField0_ & ~0x00000004);
            }
            result.nodeDef_ = nodeDef_;
          } else {
            result.nodeDef_ = nodeDefBuilder_.build();
          }
          result.ret_ = internalGetRet();
          result.ret_.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.FunctionProtos.FunctionDef) {
            return mergeFrom((com.tencent.angel.core.graph.FunctionProtos.FunctionDef)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
  
        public Builder mergeFrom(com.tencent.angel.core.graph.FunctionProtos.FunctionDef other) {
          if (other == com.tencent.angel.core.graph.FunctionProtos.FunctionDef.getDefaultInstance()) return this;
          if (other.hasSignature()) {
            mergeSignature(other.getSignature());
          }
          internalGetMutableAttr().mergeFrom(
              other.internalGetAttr());
          if (nodeDefBuilder_ == null) {
            if (!other.nodeDef_.isEmpty()) {
              if (nodeDef_.isEmpty()) {
                nodeDef_ = other.nodeDef_;
                bitField0_ = (bitField0_ & ~0x00000004);
              } else {
                ensureNodeDefIsMutable();
                nodeDef_.addAll(other.nodeDef_);
              }
              onChanged();
            }
          } else {
            if (!other.nodeDef_.isEmpty()) {
              if (nodeDefBuilder_.isEmpty()) {
                nodeDefBuilder_.dispose();
                nodeDefBuilder_ = null;
                nodeDef_ = other.nodeDef_;
                bitField0_ = (bitField0_ & ~0x00000004);
                nodeDefBuilder_ = 
                  com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                     getNodeDefFieldBuilder() : null;
              } else {
                nodeDefBuilder_.addAllMessages(other.nodeDef_);
              }
            }
          }
          internalGetMutableRet().mergeFrom(
              other.internalGetRet());
          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.FunctionProtos.FunctionDef parsedMessage = null;
          try {
            parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            parsedMessage = (com.tencent.angel.core.graph.FunctionProtos.FunctionDef) e.getUnfinishedMessage();
            throw e.unwrapIOException();
          } finally {
            if (parsedMessage != null) {
              mergeFrom(parsedMessage);
            }
          }
          return this;
        }
        private int bitField0_;
  
        private com.tencent.angel.core.graph.OpDefProtos.OpDef signature_ = null;
        private com.google.protobuf.SingleFieldBuilderV3<
            com.tencent.angel.core.graph.OpDefProtos.OpDef, com.tencent.angel.core.graph.OpDefProtos.OpDef.Builder, com.tencent.angel.core.graph.OpDefProtos.OpDefOrBuilder> signatureBuilder_;
        /**
         * <pre>
         * The definition of the function's name, arguments, return values,
         * attrs etc.
         * </pre>
         *
         * <code>.angel.OpDef signature = 1;</code>
         */
        public boolean hasSignature() {
          return signatureBuilder_ != null || signature_ != null;
        }
        /**
         * <pre>
         * The definition of the function's name, arguments, return values,
         * attrs etc.
         * </pre>
         *
         * <code>.angel.OpDef signature = 1;</code>
         */
        public com.tencent.angel.core.graph.OpDefProtos.OpDef getSignature() {
          if (signatureBuilder_ == null) {
            return signature_ == null ? com.tencent.angel.core.graph.OpDefProtos.OpDef.getDefaultInstance() : signature_;
          } else {
            return signatureBuilder_.getMessage();
          }
        }
        /**
         * <pre>
         * The definition of the function's name, arguments, return values,
         * attrs etc.
         * </pre>
         *
         * <code>.angel.OpDef signature = 1;</code>
         */
        public Builder setSignature(com.tencent.angel.core.graph.OpDefProtos.OpDef value) {
          if (signatureBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            signature_ = value;
            onChanged();
          } else {
            signatureBuilder_.setMessage(value);
          }
  
          return this;
        }
        /**
         * <pre>
         * The definition of the function's name, arguments, return values,
         * attrs etc.
         * </pre>
         *
         * <code>.angel.OpDef signature = 1;</code>
         */
        public Builder setSignature(
            com.tencent.angel.core.graph.OpDefProtos.OpDef.Builder builderForValue) {
          if (signatureBuilder_ == null) {
            signature_ = builderForValue.build();
            onChanged();
          } else {
            signatureBuilder_.setMessage(builderForValue.build());
          }
  
          return this;
        }
        /**
         * <pre>
         * The definition of the function's name, arguments, return values,
         * attrs etc.
         * </pre>
         *
         * <code>.angel.OpDef signature = 1;</code>
         */
        public Builder mergeSignature(com.tencent.angel.core.graph.OpDefProtos.OpDef value) {
          if (signatureBuilder_ == null) {
            if (signature_ != null) {
              signature_ =
                com.tencent.angel.core.graph.OpDefProtos.OpDef.newBuilder(signature_).mergeFrom(value).buildPartial();
            } else {
              signature_ = value;
            }
            onChanged();
          } else {
            signatureBuilder_.mergeFrom(value);
          }
  
          return this;
        }
        /**
         * <pre>
         * The definition of the function's name, arguments, return values,
         * attrs etc.
         * </pre>
         *
         * <code>.angel.OpDef signature = 1;</code>
         */
        public Builder clearSignature() {
          if (signatureBuilder_ == null) {
            signature_ = null;
            onChanged();
          } else {
            signature_ = null;
            signatureBuilder_ = null;
          }
  
          return this;
        }
        /**
         * <pre>
         * The definition of the function's name, arguments, return values,
         * attrs etc.
         * </pre>
         *
         * <code>.angel.OpDef signature = 1;</code>
         */
        public com.tencent.angel.core.graph.OpDefProtos.OpDef.Builder getSignatureBuilder() {
          
          onChanged();
          return getSignatureFieldBuilder().getBuilder();
        }
        /**
         * <pre>
         * The definition of the function's name, arguments, return values,
         * attrs etc.
         * </pre>
         *
         * <code>.angel.OpDef signature = 1;</code>
         */
        public com.tencent.angel.core.graph.OpDefProtos.OpDefOrBuilder getSignatureOrBuilder() {
          if (signatureBuilder_ != null) {
            return signatureBuilder_.getMessageOrBuilder();
          } else {
            return signature_ == null ?
                com.tencent.angel.core.graph.OpDefProtos.OpDef.getDefaultInstance() : signature_;
          }
        }
        /**
         * <pre>
         * The definition of the function's name, arguments, return values,
         * attrs etc.
         * </pre>
         *
         * <code>.angel.OpDef signature = 1;</code>
         */
        private com.google.protobuf.SingleFieldBuilderV3<
            com.tencent.angel.core.graph.OpDefProtos.OpDef, com.tencent.angel.core.graph.OpDefProtos.OpDef.Builder, com.tencent.angel.core.graph.OpDefProtos.OpDefOrBuilder> 
            getSignatureFieldBuilder() {
          if (signatureBuilder_ == null) {
            signatureBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
                com.tencent.angel.core.graph.OpDefProtos.OpDef, com.tencent.angel.core.graph.OpDefProtos.OpDef.Builder, com.tencent.angel.core.graph.OpDefProtos.OpDefOrBuilder>(
                    getSignature(),
                    getParentForChildren(),
                    isClean());
            signature_ = null;
          }
          return signatureBuilder_;
        }
  
        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>
         * Attributes specific to this function definition.
         * </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>
         * Attributes specific to this function definition.
         * </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>
         * Attributes specific to this function definition.
         * </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>
         * Attributes specific to this function definition.
         * </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>
         * Attributes specific to this function definition.
         * </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>
         * Attributes specific to this function definition.
         * </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>
         * Attributes specific to this function definition.
         * </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;
        }
  
        private java.util.List<com.tencent.angel.core.graph.NodeProto.NodeDef> nodeDef_ =
          java.util.Collections.emptyList();
        private void ensureNodeDefIsMutable() {
          if (!((bitField0_ & 0x00000004) == 0x00000004)) {
            nodeDef_ = new java.util.ArrayList<com.tencent.angel.core.graph.NodeProto.NodeDef>(nodeDef_);
            bitField0_ |= 0x00000004;
           }
        }
  
        private com.google.protobuf.RepeatedFieldBuilderV3<
            com.tencent.angel.core.graph.NodeProto.NodeDef, com.tencent.angel.core.graph.NodeProto.NodeDef.Builder, com.tencent.angel.core.graph.NodeProto.NodeDefOrBuilder> nodeDefBuilder_;
  
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public java.util.List<com.tencent.angel.core.graph.NodeProto.NodeDef> getNodeDefList() {
          if (nodeDefBuilder_ == null) {
            return java.util.Collections.unmodifiableList(nodeDef_);
          } else {
            return nodeDefBuilder_.getMessageList();
          }
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public int getNodeDefCount() {
          if (nodeDefBuilder_ == null) {
            return nodeDef_.size();
          } else {
            return nodeDefBuilder_.getCount();
          }
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public com.tencent.angel.core.graph.NodeProto.NodeDef getNodeDef(int index) {
          if (nodeDefBuilder_ == null) {
            return nodeDef_.get(index);
          } else {
            return nodeDefBuilder_.getMessage(index);
          }
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public Builder setNodeDef(
            int index, com.tencent.angel.core.graph.NodeProto.NodeDef value) {
          if (nodeDefBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureNodeDefIsMutable();
            nodeDef_.set(index, value);
            onChanged();
          } else {
            nodeDefBuilder_.setMessage(index, value);
          }
          return this;
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public Builder setNodeDef(
            int index, com.tencent.angel.core.graph.NodeProto.NodeDef.Builder builderForValue) {
          if (nodeDefBuilder_ == null) {
            ensureNodeDefIsMutable();
            nodeDef_.set(index, builderForValue.build());
            onChanged();
          } else {
            nodeDefBuilder_.setMessage(index, builderForValue.build());
          }
          return this;
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public Builder addNodeDef(com.tencent.angel.core.graph.NodeProto.NodeDef value) {
          if (nodeDefBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureNodeDefIsMutable();
            nodeDef_.add(value);
            onChanged();
          } else {
            nodeDefBuilder_.addMessage(value);
          }
          return this;
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public Builder addNodeDef(
            int index, com.tencent.angel.core.graph.NodeProto.NodeDef value) {
          if (nodeDefBuilder_ == null) {
            if (value == null) {
              throw new NullPointerException();
            }
            ensureNodeDefIsMutable();
            nodeDef_.add(index, value);
            onChanged();
          } else {
            nodeDefBuilder_.addMessage(index, value);
          }
          return this;
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public Builder addNodeDef(
            com.tencent.angel.core.graph.NodeProto.NodeDef.Builder builderForValue) {
          if (nodeDefBuilder_ == null) {
            ensureNodeDefIsMutable();
            nodeDef_.add(builderForValue.build());
            onChanged();
          } else {
            nodeDefBuilder_.addMessage(builderForValue.build());
          }
          return this;
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public Builder addNodeDef(
            int index, com.tencent.angel.core.graph.NodeProto.NodeDef.Builder builderForValue) {
          if (nodeDefBuilder_ == null) {
            ensureNodeDefIsMutable();
            nodeDef_.add(index, builderForValue.build());
            onChanged();
          } else {
            nodeDefBuilder_.addMessage(index, builderForValue.build());
          }
          return this;
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public Builder addAllNodeDef(
            java.lang.Iterable<? extends com.tencent.angel.core.graph.NodeProto.NodeDef> values) {
          if (nodeDefBuilder_ == null) {
            ensureNodeDefIsMutable();
            com.google.protobuf.AbstractMessageLite.Builder.addAll(
                values, nodeDef_);
            onChanged();
          } else {
            nodeDefBuilder_.addAllMessages(values);
          }
          return this;
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public Builder clearNodeDef() {
          if (nodeDefBuilder_ == null) {
            nodeDef_ = java.util.Collections.emptyList();
            bitField0_ = (bitField0_ & ~0x00000004);
            onChanged();
          } else {
            nodeDefBuilder_.clear();
          }
          return this;
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public Builder removeNodeDef(int index) {
          if (nodeDefBuilder_ == null) {
            ensureNodeDefIsMutable();
            nodeDef_.remove(index);
            onChanged();
          } else {
            nodeDefBuilder_.remove(index);
          }
          return this;
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public com.tencent.angel.core.graph.NodeProto.NodeDef.Builder getNodeDefBuilder(
            int index) {
          return getNodeDefFieldBuilder().getBuilder(index);
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public com.tencent.angel.core.graph.NodeProto.NodeDefOrBuilder getNodeDefOrBuilder(
            int index) {
          if (nodeDefBuilder_ == null) {
            return nodeDef_.get(index);  } else {
            return nodeDefBuilder_.getMessageOrBuilder(index);
          }
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public java.util.List<? extends com.tencent.angel.core.graph.NodeProto.NodeDefOrBuilder> 
             getNodeDefOrBuilderList() {
          if (nodeDefBuilder_ != null) {
            return nodeDefBuilder_.getMessageOrBuilderList();
          } else {
            return java.util.Collections.unmodifiableList(nodeDef_);
          }
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public com.tencent.angel.core.graph.NodeProto.NodeDef.Builder addNodeDefBuilder() {
          return getNodeDefFieldBuilder().addBuilder(
              com.tencent.angel.core.graph.NodeProto.NodeDef.getDefaultInstance());
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public com.tencent.angel.core.graph.NodeProto.NodeDef.Builder addNodeDefBuilder(
            int index) {
          return getNodeDefFieldBuilder().addBuilder(
              index, com.tencent.angel.core.graph.NodeProto.NodeDef.getDefaultInstance());
        }
        /**
         * <pre>
         * By convention, "op" in node_def is resolved by consulting with a
         * user-defined library first. If not resolved, "func" is assumed to
         * be a builtin op.
         * </pre>
         *
         * <code>repeated .angel.NodeDef node_def = 3;</code>
         */
        public java.util.List<com.tencent.angel.core.graph.NodeProto.NodeDef.Builder> 
             getNodeDefBuilderList() {
          return getNodeDefFieldBuilder().getBuilderList();
        }
        private com.google.protobuf.RepeatedFieldBuilderV3<
            com.tencent.angel.core.graph.NodeProto.NodeDef, com.tencent.angel.core.graph.NodeProto.NodeDef.Builder, com.tencent.angel.core.graph.NodeProto.NodeDefOrBuilder> 
            getNodeDefFieldBuilder() {
          if (nodeDefBuilder_ == null) {
            nodeDefBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
                com.tencent.angel.core.graph.NodeProto.NodeDef, com.tencent.angel.core.graph.NodeProto.NodeDef.Builder, com.tencent.angel.core.graph.NodeProto.NodeDefOrBuilder>(
                    nodeDef_,
                    ((bitField0_ & 0x00000004) == 0x00000004),
                    getParentForChildren(),
                    isClean());
            nodeDef_ = null;
          }
          return nodeDefBuilder_;
        }
  
        private com.google.protobuf.MapField<
            java.lang.String, java.lang.String> ret_;
        private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetRet() {
          if (ret_ == null) {
            return com.google.protobuf.MapField.emptyMapField(
                RetDefaultEntryHolder.defaultEntry);
          }
          return ret_;
        }
        private com.google.protobuf.MapField<java.lang.String, java.lang.String>
        internalGetMutableRet() {
          onChanged();;
          if (ret_ == null) {
            ret_ = com.google.protobuf.MapField.newMapField(
                RetDefaultEntryHolder.defaultEntry);
          }
          if (!ret_.isMutable()) {
            ret_ = ret_.copy();
          }
          return ret_;
        }
  
        public int getRetCount() {
          return internalGetRet().getMap().size();
        }
        /**
         * <pre>
         * A mapping from the output arg names from `signature` to the
         * outputs from `node_def` that should be returned by the function.
         * </pre>
         *
         * <code>map&lt;string, string&gt; ret = 4;</code>
         */
  
        public boolean containsRet(
            java.lang.String key) {
          if (key == null) { throw new java.lang.NullPointerException(); }
          return internalGetRet().getMap().containsKey(key);
        }
        /**
         * Use {@link #getRetMap()} instead.
         */
        @java.lang.Deprecated
        public java.util.Map<java.lang.String, java.lang.String> getRet() {
          return getRetMap();
        }
        /**
         * <pre>
         * A mapping from the output arg names from `signature` to the
         * outputs from `node_def` that should be returned by the function.
         * </pre>
         *
         * <code>map&lt;string, string&gt; ret = 4;</code>
         */
  
        public java.util.Map<java.lang.String, java.lang.String> getRetMap() {
          return internalGetRet().getMap();
        }
        /**
         * <pre>
         * A mapping from the output arg names from `signature` to the
         * outputs from `node_def` that should be returned by the function.
         * </pre>
         *
         * <code>map&lt;string, string&gt; ret = 4;</code>
         */
  
        public java.lang.String getRetOrDefault(
            java.lang.String key,
            java.lang.String defaultValue) {
          if (key == null) { throw new java.lang.NullPointerException(); }
          java.util.Map<java.lang.String, java.lang.String> map =
              internalGetRet().getMap();
          return map.containsKey(key) ? map.get(key) : defaultValue;
        }
        /**
         * <pre>
         * A mapping from the output arg names from `signature` to the
         * outputs from `node_def` that should be returned by the function.
         * </pre>
         *
         * <code>map&lt;string, string&gt; ret = 4;</code>
         */
  
        public java.lang.String getRetOrThrow(
            java.lang.String key) {
          if (key == null) { throw new java.lang.NullPointerException(); }
          java.util.Map<java.lang.String, java.lang.String> map =
              internalGetRet().getMap();
          if (!map.containsKey(key)) {
            throw new java.lang.IllegalArgumentException();
          }
          return map.get(key);
        }
  
        public Builder clearRet() {
          internalGetMutableRet().getMutableMap()
              .clear();
          return this;
        }
        /**
         * <pre>
         * A mapping from the output arg names from `signature` to the
         * outputs from `node_def` that should be returned by the function.
         * </pre>
         *
         * <code>map&lt;string, string&gt; ret = 4;</code>
         */
  
        public Builder removeRet(
            java.lang.String key) {
          if (key == null) { throw new java.lang.NullPointerException(); }
          internalGetMutableRet().getMutableMap()
              .remove(key);
          return this;
        }
        /**
         * Use alternate mutation accessors instead.
         */
        @java.lang.Deprecated
        public java.util.Map<java.lang.String, java.lang.String>
        getMutableRet() {
          return internalGetMutableRet().getMutableMap();
        }
        /**
         * <pre>
         * A mapping from the output arg names from `signature` to the
         * outputs from `node_def` that should be returned by the function.
         * </pre>
         *
         * <code>map&lt;string, string&gt; ret = 4;</code>
         */
        public Builder putRet(
            java.lang.String key,
            java.lang.String value) {
          if (key == null) { throw new java.lang.NullPointerException(); }
          if (value == null) { throw new java.lang.NullPointerException(); }
          internalGetMutableRet().getMutableMap()
              .put(key, value);
          return this;
        }
        /**
         * <pre>
         * A mapping from the output arg names from `signature` to the
         * outputs from `node_def` that should be returned by the function.
         * </pre>
         *
         * <code>map&lt;string, string&gt; ret = 4;</code>
         */
  
        public Builder putAllRet(
            java.util.Map<java.lang.String, java.lang.String> values) {
          internalGetMutableRet().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.FunctionDef)
      }
  
      // @@protoc_insertion_point(class_scope:angel.FunctionDef)
      private static final com.tencent.angel.core.graph.FunctionProtos.FunctionDef DEFAULT_INSTANCE;
      static {
        DEFAULT_INSTANCE = new com.tencent.angel.core.graph.FunctionProtos.FunctionDef();
      }
  
      public static com.tencent.angel.core.graph.FunctionProtos.FunctionDef getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }
  
      private static final com.google.protobuf.Parser<FunctionDef>
          PARSER = new com.google.protobuf.AbstractParser<FunctionDef>() {
        public FunctionDef parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new FunctionDef(input, extensionRegistry);
        }
      };
  
      public static com.google.protobuf.Parser<FunctionDef> parser() {
        return PARSER;
      }
  
      @java.lang.Override
      public com.google.protobuf.Parser<FunctionDef> getParserForType() {
        return PARSER;
      }
  
      public com.tencent.angel.core.graph.FunctionProtos.FunctionDef getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }
  
    }
  
    public interface GradientDefOrBuilder extends
        // @@protoc_insertion_point(interface_extends:angel.GradientDef)
        com.google.protobuf.MessageOrBuilder {
  
      /**
       * <pre>
       * The function name.
       * </pre>
       *
       * <code>string function_name = 1;</code>
       */
      java.lang.String getFunctionName();
      /**
       * <pre>
       * The function name.
       * </pre>
       *
       * <code>string function_name = 1;</code>
       */
      com.google.protobuf.ByteString
          getFunctionNameBytes();
  
      /**
       * <pre>
       * The gradient function's name.
       * </pre>
       *
       * <code>string gradient_func = 2;</code>
       */
      java.lang.String getGradientFunc();
      /**
       * <pre>
       * The gradient function's name.
       * </pre>
       *
       * <code>string gradient_func = 2;</code>
       */
      com.google.protobuf.ByteString
          getGradientFuncBytes();
    }
    /**
     * <pre>
     * GradientDef defines the gradient function of a function defined in
     * a function library.
     * A gradient function g (specified by gradient_func) for a function f
     * (specified by function_name) must follow the following:
     * The function 'f' must be a numerical function which takes N inputs
     * and produces M outputs. Its gradient function 'g', which is a
     * function taking N + M inputs and produces N outputs.
     * I.e. if we have
     *    (y1, y2, ..., y_M) = f(x1, x2, ..., x_N),
     * then, g is
     *    (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
     *                                      dL/dy1, dL/dy2, ..., dL/dy_M),
     * where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the
     * loss function). dL/dx_i is the partial derivative of L with respect
     * to x_i.
     * </pre>
     *
     * Protobuf type {@code angel.GradientDef}
     */
    public  static final class GradientDef extends
        com.google.protobuf.GeneratedMessageV3 implements
        // @@protoc_insertion_point(message_implements:angel.GradientDef)
        GradientDefOrBuilder {
    private static final long serialVersionUID = 0L;
      // Use GradientDef.newBuilder() to construct.
      private GradientDef(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
        super(builder);
      }
      private GradientDef() {
        functionName_ = "";
        gradientFunc_ = "";
      }
  
      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet
      getUnknownFields() {
        return this.unknownFields;
      }
      private GradientDef(
          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();
  
                functionName_ = s;
                break;
              }
              case 18: {
                java.lang.String s = input.readStringRequireUtf8();
  
                gradientFunc_ = s;
                break;
              }
            }
          }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.setUnfinishedMessage(this);
        } catch (java.io.IOException e) {
          throw new com.google.protobuf.InvalidProtocolBufferException(
              e).setUnfinishedMessage(this);
        } finally {
          this.unknownFields = unknownFields.build();
          makeExtensionsImmutable();
        }
      }
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_GradientDef_descriptor;
      }
  
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_GradientDef_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                com.tencent.angel.core.graph.FunctionProtos.GradientDef.class, com.tencent.angel.core.graph.FunctionProtos.GradientDef.Builder.class);
      }
  
      public static final int FUNCTION_NAME_FIELD_NUMBER = 1;
      private volatile java.lang.Object functionName_;
      /**
       * <pre>
       * The function name.
       * </pre>
       *
       * <code>string function_name = 1;</code>
       */
      public java.lang.String getFunctionName() {
        java.lang.Object ref = functionName_;
        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();
          functionName_ = s;
          return s;
        }
      }
      /**
       * <pre>
       * The function name.
       * </pre>
       *
       * <code>string function_name = 1;</code>
       */
      public com.google.protobuf.ByteString
          getFunctionNameBytes() {
        java.lang.Object ref = functionName_;
        if (ref instanceof java.lang.String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          functionName_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
  
      public static final int GRADIENT_FUNC_FIELD_NUMBER = 2;
      private volatile java.lang.Object gradientFunc_;
      /**
       * <pre>
       * The gradient function's name.
       * </pre>
       *
       * <code>string gradient_func = 2;</code>
       */
      public java.lang.String getGradientFunc() {
        java.lang.Object ref = gradientFunc_;
        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();
          gradientFunc_ = s;
          return s;
        }
      }
      /**
       * <pre>
       * The gradient function's name.
       * </pre>
       *
       * <code>string gradient_func = 2;</code>
       */
      public com.google.protobuf.ByteString
          getGradientFuncBytes() {
        java.lang.Object ref = gradientFunc_;
        if (ref instanceof java.lang.String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          gradientFunc_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
  
      private byte memoizedIsInitialized = -1;
      public final boolean isInitialized() {
        byte isInitialized = memoizedIsInitialized;
        if (isInitialized == 1) return true;
        if (isInitialized == 0) return false;
  
        memoizedIsInitialized = 1;
        return true;
      }
  
      public void writeTo(com.google.protobuf.CodedOutputStream output)
                          throws java.io.IOException {
        if (!getFunctionNameBytes().isEmpty()) {
          com.google.protobuf.GeneratedMessageV3.writeString(output, 1, functionName_);
        }
        if (!getGradientFuncBytes().isEmpty()) {
          com.google.protobuf.GeneratedMessageV3.writeString(output, 2, gradientFunc_);
        }
        unknownFields.writeTo(output);
      }
  
      public int getSerializedSize() {
        int size = memoizedSize;
        if (size != -1) return size;
  
        size = 0;
        if (!getFunctionNameBytes().isEmpty()) {
          size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, functionName_);
        }
        if (!getGradientFuncBytes().isEmpty()) {
          size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, gradientFunc_);
        }
        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.FunctionProtos.GradientDef)) {
          return super.equals(obj);
        }
        com.tencent.angel.core.graph.FunctionProtos.GradientDef other = (com.tencent.angel.core.graph.FunctionProtos.GradientDef) obj;
  
        boolean result = true;
        result = result && getFunctionName()
            .equals(other.getFunctionName());
        result = result && getGradientFunc()
            .equals(other.getGradientFunc());
        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) + FUNCTION_NAME_FIELD_NUMBER;
        hash = (53 * hash) + getFunctionName().hashCode();
        hash = (37 * hash) + GRADIENT_FUNC_FIELD_NUMBER;
        hash = (53 * hash) + getGradientFunc().hashCode();
        hash = (29 * hash) + unknownFields.hashCode();
        memoizedHashCode = hash;
        return hash;
      }
  
      public static com.tencent.angel.core.graph.FunctionProtos.GradientDef parseFrom(
          java.nio.ByteBuffer data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.GradientDef 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.FunctionProtos.GradientDef parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.GradientDef 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.FunctionProtos.GradientDef parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.GradientDef 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.FunctionProtos.GradientDef parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseWithIOException(PARSER, input);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.GradientDef 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.FunctionProtos.GradientDef parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3
            .parseDelimitedWithIOException(PARSER, input);
      }
      public static com.tencent.angel.core.graph.FunctionProtos.GradientDef 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.FunctionProtos.GradientDef 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.FunctionProtos.GradientDef 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.FunctionProtos.GradientDef prototype) {
        return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() {
        return this == DEFAULT_INSTANCE
            ? new Builder() : new Builder().mergeFrom(this);
      }
  
      @java.lang.Override
      protected Builder newBuilderForType(
          com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
        Builder builder = new Builder(parent);
        return builder;
      }
      /**
       * <pre>
       * GradientDef defines the gradient function of a function defined in
       * a function library.
       * A gradient function g (specified by gradient_func) for a function f
       * (specified by function_name) must follow the following:
       * The function 'f' must be a numerical function which takes N inputs
       * and produces M outputs. Its gradient function 'g', which is a
       * function taking N + M inputs and produces N outputs.
       * I.e. if we have
       *    (y1, y2, ..., y_M) = f(x1, x2, ..., x_N),
       * then, g is
       *    (dL/dx1, dL/dx2, ..., dL/dx_N) = g(x1, x2, ..., x_N,
       *                                      dL/dy1, dL/dy2, ..., dL/dy_M),
       * where L is a scalar-value function of (x1, x2, ..., xN) (e.g., the
       * loss function). dL/dx_i is the partial derivative of L with respect
       * to x_i.
       * </pre>
       *
       * Protobuf type {@code angel.GradientDef}
       */
      public static final class Builder extends
          com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
          // @@protoc_insertion_point(builder_implements:angel.GradientDef)
          com.tencent.angel.core.graph.FunctionProtos.GradientDefOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor
            getDescriptor() {
          return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_GradientDef_descriptor;
        }
  
        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_GradientDef_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  com.tencent.angel.core.graph.FunctionProtos.GradientDef.class, com.tencent.angel.core.graph.FunctionProtos.GradientDef.Builder.class);
        }
  
        // Construct using com.tencent.angel.core.graph.FunctionProtos.GradientDef.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();
          functionName_ = "";
  
          gradientFunc_ = "";
  
          return this;
        }
  
        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return com.tencent.angel.core.graph.FunctionProtos.internal_static_angel_GradientDef_descriptor;
        }
  
        public com.tencent.angel.core.graph.FunctionProtos.GradientDef getDefaultInstanceForType() {
          return com.tencent.angel.core.graph.FunctionProtos.GradientDef.getDefaultInstance();
        }
  
        public com.tencent.angel.core.graph.FunctionProtos.GradientDef build() {
          com.tencent.angel.core.graph.FunctionProtos.GradientDef result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }
  
        public com.tencent.angel.core.graph.FunctionProtos.GradientDef buildPartial() {
          com.tencent.angel.core.graph.FunctionProtos.GradientDef result = new com.tencent.angel.core.graph.FunctionProtos.GradientDef(this);
          result.functionName_ = functionName_;
          result.gradientFunc_ = gradientFunc_;
          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.FunctionProtos.GradientDef) {
            return mergeFrom((com.tencent.angel.core.graph.FunctionProtos.GradientDef)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }
  
        public Builder mergeFrom(com.tencent.angel.core.graph.FunctionProtos.GradientDef other) {
          if (other == com.tencent.angel.core.graph.FunctionProtos.GradientDef.getDefaultInstance()) return this;
          if (!other.getFunctionName().isEmpty()) {
            functionName_ = other.functionName_;
            onChanged();
          }
          if (!other.getGradientFunc().isEmpty()) {
            gradientFunc_ = other.gradientFunc_;
            onChanged();
          }
          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.FunctionProtos.GradientDef parsedMessage = null;
          try {
            parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            parsedMessage = (com.tencent.angel.core.graph.FunctionProtos.GradientDef) e.getUnfinishedMessage();
            throw e.unwrapIOException();
          } finally {
            if (parsedMessage != null) {
              mergeFrom(parsedMessage);
            }
          }
          return this;
        }
  
        private java.lang.Object functionName_ = "";
        /**
         * <pre>
         * The function name.
         * </pre>
         *
         * <code>string function_name = 1;</code>
         */
        public java.lang.String getFunctionName() {
          java.lang.Object ref = functionName_;
          if (!(ref instanceof java.lang.String)) {
            com.google.protobuf.ByteString bs =
                (com.google.protobuf.ByteString) ref;
            java.lang.String s = bs.toStringUtf8();
            functionName_ = s;
            return s;
          } else {
            return (java.lang.String) ref;
          }
        }
        /**
         * <pre>
         * The function name.
         * </pre>
         *
         * <code>string function_name = 1;</code>
         */
        public com.google.protobuf.ByteString
            getFunctionNameBytes() {
          java.lang.Object ref = functionName_;
          if (ref instanceof String) {
            com.google.protobuf.ByteString b = 
                com.google.protobuf.ByteString.copyFromUtf8(
                    (java.lang.String) ref);
            functionName_ = b;
            return b;
          } else {
            return (com.google.protobuf.ByteString) ref;
          }
        }
        /**
         * <pre>
         * The function name.
         * </pre>
         *
         * <code>string function_name = 1;</code>
         */
        public Builder setFunctionName(
            java.lang.String value) {
          if (value == null) {
      throw new NullPointerException();
    }
    
          functionName_ = value;
          onChanged();
          return this;
        }
        /**
         * <pre>
         * The function name.
         * </pre>
         *
         * <code>string function_name = 1;</code>
         */
        public Builder clearFunctionName() {
          
          functionName_ = getDefaultInstance().getFunctionName();
          onChanged();
          return this;
        }
        /**
         * <pre>
         * The function name.
         * </pre>
         *
         * <code>string function_name = 1;</code>
         */
        public Builder setFunctionNameBytes(
            com.google.protobuf.ByteString value) {
          if (value == null) {
      throw new NullPointerException();
    }
    checkByteStringIsUtf8(value);
          
          functionName_ = value;
          onChanged();
          return this;
        }
  
        private java.lang.Object gradientFunc_ = "";
        /**
         * <pre>
         * The gradient function's name.
         * </pre>
         *
         * <code>string gradient_func = 2;</code>
         */
        public java.lang.String getGradientFunc() {
          java.lang.Object ref = gradientFunc_;
          if (!(ref instanceof java.lang.String)) {
            com.google.protobuf.ByteString bs =
                (com.google.protobuf.ByteString) ref;
            java.lang.String s = bs.toStringUtf8();
            gradientFunc_ = s;
            return s;
          } else {
            return (java.lang.String) ref;
          }
        }
        /**
         * <pre>
         * The gradient function's name.
         * </pre>
         *
         * <code>string gradient_func = 2;</code>
         */
        public com.google.protobuf.ByteString
            getGradientFuncBytes() {
          java.lang.Object ref = gradientFunc_;
          if (ref instanceof String) {
            com.google.protobuf.ByteString b = 
                com.google.protobuf.ByteString.copyFromUtf8(
                    (java.lang.String) ref);
            gradientFunc_ = b;
            return b;
          } else {
            return (com.google.protobuf.ByteString) ref;
          }
        }
        /**
         * <pre>
         * The gradient function's name.
         * </pre>
         *
         * <code>string gradient_func = 2;</code>
         */
        public Builder setGradientFunc(
            java.lang.String value) {
          if (value == null) {
      throw new NullPointerException();
    }
    
          gradientFunc_ = value;
          onChanged();
          return this;
        }
        /**
         * <pre>
         * The gradient function's name.
         * </pre>
         *
         * <code>string gradient_func = 2;</code>
         */
        public Builder clearGradientFunc() {
          
          gradientFunc_ = getDefaultInstance().getGradientFunc();
          onChanged();
          return this;
        }
        /**
         * <pre>
         * The gradient function's name.
         * </pre>
         *
         * <code>string gradient_func = 2;</code>
         */
        public Builder setGradientFuncBytes(
            com.google.protobuf.ByteString value) {
          if (value == null) {
      throw new NullPointerException();
    }
    checkByteStringIsUtf8(value);
          
          gradientFunc_ = value;
          onChanged();
          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.GradientDef)
      }
  
      // @@protoc_insertion_point(class_scope:angel.GradientDef)
      private static final com.tencent.angel.core.graph.FunctionProtos.GradientDef DEFAULT_INSTANCE;
      static {
        DEFAULT_INSTANCE = new com.tencent.angel.core.graph.FunctionProtos.GradientDef();
      }
  
      public static com.tencent.angel.core.graph.FunctionProtos.GradientDef getDefaultInstance() {
        return DEFAULT_INSTANCE;
      }
  
      private static final com.google.protobuf.Parser<GradientDef>
          PARSER = new com.google.protobuf.AbstractParser<GradientDef>() {
        public GradientDef parsePartialFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
          return new GradientDef(input, extensionRegistry);
        }
      };
  
      public static com.google.protobuf.Parser<GradientDef> parser() {
        return PARSER;
      }
  
      @java.lang.Override
      public com.google.protobuf.Parser<GradientDef> getParserForType() {
        return PARSER;
      }
  
      public com.tencent.angel.core.graph.FunctionProtos.GradientDef getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
      }
  
    }
  
    private static final com.google.protobuf.Descriptors.Descriptor
      internal_static_angel_FunctionDefLibrary_descriptor;
    private static final 
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internal_static_angel_FunctionDefLibrary_fieldAccessorTable;
    private static final com.google.protobuf.Descriptors.Descriptor
      internal_static_angel_FunctionDef_descriptor;
    private static final 
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internal_static_angel_FunctionDef_fieldAccessorTable;
    private static final com.google.protobuf.Descriptors.Descriptor
      internal_static_angel_FunctionDef_AttrEntry_descriptor;
    private static final 
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internal_static_angel_FunctionDef_AttrEntry_fieldAccessorTable;
    private static final com.google.protobuf.Descriptors.Descriptor
      internal_static_angel_FunctionDef_RetEntry_descriptor;
    private static final 
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internal_static_angel_FunctionDef_RetEntry_fieldAccessorTable;
    private static final com.google.protobuf.Descriptors.Descriptor
      internal_static_angel_GradientDef_descriptor;
    private static final 
      com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internal_static_angel_GradientDef_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/function.proto\022\005angel\032\033core" +
        "/graph/attr_value.proto\032\031core/graph/node" +
        "_def.proto\032\027core/graph/op_def.proto\"`\n\022F" +
        "unctionDefLibrary\022$\n\010function\030\001 \003(\0132\022.an" +
        "gel.FunctionDef\022$\n\010gradient\030\002 \003(\0132\022.ange" +
        "l.GradientDef\"\227\002\n\013FunctionDef\022\037\n\tsignatu" +
        "re\030\001 \001(\0132\014.angel.OpDef\022*\n\004attr\030\005 \003(\0132\034.a" +
        "ngel.FunctionDef.AttrEntry\022 \n\010node_def\030\003" +
        " \003(\0132\016.angel.NodeDef\022(\n\003ret\030\004 \003(\0132\033.ange" +
        "l.FunctionDef.RetEntry\032=\n\tAttrEntry\022\013\n\003k" +
        "ey\030\001 \001(\t\022\037\n\005value\030\002 \001(\0132\020.angel.AttrValu" +
        "e:\0028\001\032*\n\010RetEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030" +
        "\002 \001(\t:\0028\001J\004\010\002\020\003\";\n\013GradientDef\022\025\n\rfuncti" +
        "on_name\030\001 \001(\t\022\025\n\rgradient_func\030\002 \001(\tB0\n\034" +
        "com.tencent.angel.core.graphB\016FunctionPr" +
        "otosP\000b\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(),
            com.tencent.angel.core.graph.NodeProto.getDescriptor(),
            com.tencent.angel.core.graph.OpDefProtos.getDescriptor(),
          }, assigner);
      internal_static_angel_FunctionDefLibrary_descriptor =
        getDescriptor().getMessageTypes().get(0);
      internal_static_angel_FunctionDefLibrary_fieldAccessorTable = new
        com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
          internal_static_angel_FunctionDefLibrary_descriptor,
          new java.lang.String[] { "Function", "Gradient", });
      internal_static_angel_FunctionDef_descriptor =
        getDescriptor().getMessageTypes().get(1);
      internal_static_angel_FunctionDef_fieldAccessorTable = new
        com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
          internal_static_angel_FunctionDef_descriptor,
          new java.lang.String[] { "Signature", "Attr", "NodeDef", "Ret", });
      internal_static_angel_FunctionDef_AttrEntry_descriptor =
        internal_static_angel_FunctionDef_descriptor.getNestedTypes().get(0);
      internal_static_angel_FunctionDef_AttrEntry_fieldAccessorTable = new
        com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
          internal_static_angel_FunctionDef_AttrEntry_descriptor,
          new java.lang.String[] { "Key", "Value", });
      internal_static_angel_FunctionDef_RetEntry_descriptor =
        internal_static_angel_FunctionDef_descriptor.getNestedTypes().get(1);
      internal_static_angel_FunctionDef_RetEntry_fieldAccessorTable = new
        com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
          internal_static_angel_FunctionDef_RetEntry_descriptor,
          new java.lang.String[] { "Key", "Value", });
      internal_static_angel_GradientDef_descriptor =
        getDescriptor().getMessageTypes().get(2);
      internal_static_angel_GradientDef_fieldAccessorTable = new
        com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
          internal_static_angel_GradientDef_descriptor,
          new java.lang.String[] { "FunctionName", "GradientFunc", });
      com.tencent.angel.core.graph.AttrValueProtos.getDescriptor();
      com.tencent.angel.core.graph.NodeProto.getDescriptor();
      com.tencent.angel.core.graph.OpDefProtos.getDescriptor();
    }
  
    // @@protoc_insertion_point(outer_class_scope)
  }
  