Class SignatureDef.Builder

  • All Implemented Interfaces:
    Cloneable, org.nd4j.shade.protobuf.Message.Builder, org.nd4j.shade.protobuf.MessageLite.Builder, org.nd4j.shade.protobuf.MessageLiteOrBuilder, org.nd4j.shade.protobuf.MessageOrBuilder, SignatureDefOrBuilder
    Enclosing class:
    SignatureDef

    public static final class SignatureDef.Builder
    extends org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
    implements SignatureDefOrBuilder
     SignatureDef defines the signature of a computation supported by a TensorFlow
     graph.
     For example, a model with two loss computations, sharing a single input,
     might have the following signature_def map.
     Note that across the two SignatureDefs "loss_A" and "loss_B", the input key,
     output key, and method_name are identical, and will be used by system(s) that
     implement or rely upon this particular loss method. The output tensor names
     differ, demonstrating how different outputs can exist for the same method.
     signature_def {
       key: "loss_A"
       value {
         inputs {
           key: "input"
           value {
             name: "input:0"
             dtype: DT_STRING
             tensor_shape: ...
           }
         }
         outputs {
           key: "loss_output"
           value {
             name: "loss_output_A:0"
             dtype: DT_FLOAT
             tensor_shape: ...
           }
         }
       }
       ...
       method_name: "some/package/compute_loss"
     }
     signature_def {
       key: "loss_B"
       value {
         inputs {
           key: "input"
           value {
             name: "input:0"
             dtype: DT_STRING
             tensor_shape: ...
           }
         }
         outputs {
           key: "loss_output"
           value {
             name: "loss_output_B:0"
             dtype: DT_FLOAT
             tensor_shape: ...
           }
         }
       }
       ...
       method_name: "some/package/compute_loss"
     }
     
    Protobuf type tensorflow.SignatureDef
    • Method Detail

      • getDescriptor

        public static final org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetMapField

        protected org.nd4j.shade.protobuf.MapField internalGetMapField​(int number)
        Overrides:
        internalGetMapField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • internalGetMutableMapField

        protected org.nd4j.shade.protobuf.MapField internalGetMutableMapField​(int number)
        Overrides:
        internalGetMutableMapField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • internalGetFieldAccessorTable

        protected org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • clear

        public SignatureDef.Builder clear()
        Specified by:
        clear in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        clear in interface org.nd4j.shade.protobuf.MessageLite.Builder
        Overrides:
        clear in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • getDescriptorForType

        public org.nd4j.shade.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface org.nd4j.shade.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • getDefaultInstanceForType

        public SignatureDef getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageOrBuilder
      • build

        public SignatureDef build()
        Specified by:
        build in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        build in interface org.nd4j.shade.protobuf.MessageLite.Builder
      • buildPartial

        public SignatureDef buildPartial()
        Specified by:
        buildPartial in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        buildPartial in interface org.nd4j.shade.protobuf.MessageLite.Builder
      • clone

        public SignatureDef.Builder clone()
        Specified by:
        clone in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        clone in interface org.nd4j.shade.protobuf.MessageLite.Builder
        Overrides:
        clone in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • setField

        public SignatureDef.Builder setField​(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field,
                                             Object value)
        Specified by:
        setField in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        setField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • clearField

        public SignatureDef.Builder clearField​(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        clearField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • clearOneof

        public SignatureDef.Builder clearOneof​(org.nd4j.shade.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        clearOneof in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • setRepeatedField

        public SignatureDef.Builder setRepeatedField​(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field,
                                                     int index,
                                                     Object value)
        Specified by:
        setRepeatedField in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • addRepeatedField

        public SignatureDef.Builder addRepeatedField​(org.nd4j.shade.protobuf.Descriptors.FieldDescriptor field,
                                                     Object value)
        Specified by:
        addRepeatedField in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • mergeFrom

        public SignatureDef.Builder mergeFrom​(org.nd4j.shade.protobuf.Message other)
        Specified by:
        mergeFrom in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        mergeFrom in class org.nd4j.shade.protobuf.AbstractMessage.Builder<SignatureDef.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface org.nd4j.shade.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • mergeFrom

        public SignatureDef.Builder mergeFrom​(org.nd4j.shade.protobuf.CodedInputStream input,
                                              org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
                                       throws IOException
        Specified by:
        mergeFrom in interface org.nd4j.shade.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface org.nd4j.shade.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class org.nd4j.shade.protobuf.AbstractMessage.Builder<SignatureDef.Builder>
        Throws:
        IOException
      • removeInputs

        public SignatureDef.Builder removeInputs​(String key)
         Named input parameters.
         
        map<string, .tensorflow.TensorInfo> inputs = 1;
      • removeOutputs

        public SignatureDef.Builder removeOutputs​(String key)
         Named output parameters.
         
        map<string, .tensorflow.TensorInfo> outputs = 2;
      • getMethodName

        public String getMethodName()
         Extensible method_name information enabling third-party users to mark a
         SignatureDef as supporting a particular method. This enables producers and
         consumers of SignatureDefs, e.g. a model definition library and a serving
         library to have a clear hand-off regarding the semantics of a computation.
         Note that multiple SignatureDefs in a single MetaGraphDef may have the same
         method_name. This is commonly used to support multi-headed computation,
         where a single graph computation may return multiple results.
         
        string method_name = 3;
        Specified by:
        getMethodName in interface SignatureDefOrBuilder
        Returns:
        The methodName.
      • getMethodNameBytes

        public org.nd4j.shade.protobuf.ByteString getMethodNameBytes()
         Extensible method_name information enabling third-party users to mark a
         SignatureDef as supporting a particular method. This enables producers and
         consumers of SignatureDefs, e.g. a model definition library and a serving
         library to have a clear hand-off regarding the semantics of a computation.
         Note that multiple SignatureDefs in a single MetaGraphDef may have the same
         method_name. This is commonly used to support multi-headed computation,
         where a single graph computation may return multiple results.
         
        string method_name = 3;
        Specified by:
        getMethodNameBytes in interface SignatureDefOrBuilder
        Returns:
        The bytes for methodName.
      • setMethodName

        public SignatureDef.Builder setMethodName​(String value)
         Extensible method_name information enabling third-party users to mark a
         SignatureDef as supporting a particular method. This enables producers and
         consumers of SignatureDefs, e.g. a model definition library and a serving
         library to have a clear hand-off regarding the semantics of a computation.
         Note that multiple SignatureDefs in a single MetaGraphDef may have the same
         method_name. This is commonly used to support multi-headed computation,
         where a single graph computation may return multiple results.
         
        string method_name = 3;
        Parameters:
        value - The methodName to set.
        Returns:
        This builder for chaining.
      • clearMethodName

        public SignatureDef.Builder clearMethodName()
         Extensible method_name information enabling third-party users to mark a
         SignatureDef as supporting a particular method. This enables producers and
         consumers of SignatureDefs, e.g. a model definition library and a serving
         library to have a clear hand-off regarding the semantics of a computation.
         Note that multiple SignatureDefs in a single MetaGraphDef may have the same
         method_name. This is commonly used to support multi-headed computation,
         where a single graph computation may return multiple results.
         
        string method_name = 3;
        Returns:
        This builder for chaining.
      • setMethodNameBytes

        public SignatureDef.Builder setMethodNameBytes​(org.nd4j.shade.protobuf.ByteString value)
         Extensible method_name information enabling third-party users to mark a
         SignatureDef as supporting a particular method. This enables producers and
         consumers of SignatureDefs, e.g. a model definition library and a serving
         library to have a clear hand-off regarding the semantics of a computation.
         Note that multiple SignatureDefs in a single MetaGraphDef may have the same
         method_name. This is commonly used to support multi-headed computation,
         where a single graph computation may return multiple results.
         
        string method_name = 3;
        Parameters:
        value - The bytes for methodName to set.
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final SignatureDef.Builder setUnknownFields​(org.nd4j.shade.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>
      • mergeUnknownFields

        public final SignatureDef.Builder mergeUnknownFields​(org.nd4j.shade.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface org.nd4j.shade.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class org.nd4j.shade.protobuf.GeneratedMessageV3.Builder<SignatureDef.Builder>