Class OpDef

  • All Implemented Interfaces:
    Serializable, org.nd4j.shade.protobuf.Message, org.nd4j.shade.protobuf.MessageLite, org.nd4j.shade.protobuf.MessageLiteOrBuilder, org.nd4j.shade.protobuf.MessageOrBuilder, OpDefOrBuilder

    public final class OpDef
    extends org.nd4j.shade.protobuf.GeneratedMessageV3
    implements OpDefOrBuilder
     Defines an operation. A NodeDef in a GraphDef specifies an Op by
     using the "op" field which should match the name of a OpDef.
     LINT.IfChange
     
    Protobuf type tensorflow.OpDef
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(org.nd4j.shade.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • getUnknownFields

        public final org.nd4j.shade.protobuf.UnknownFieldSet getUnknownFields()
        Specified by:
        getUnknownFields in interface org.nd4j.shade.protobuf.MessageOrBuilder
        Overrides:
        getUnknownFields in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • getDescriptor

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

        protected org.nd4j.shade.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • getName

        public String getName()
         Op names starting with an underscore are reserved for internal use.
         Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9_]*".
         
        string name = 1;
        Specified by:
        getName in interface OpDefOrBuilder
        Returns:
        The name.
      • getNameBytes

        public org.nd4j.shade.protobuf.ByteString getNameBytes()
         Op names starting with an underscore are reserved for internal use.
         Names should be CamelCase and match the regexp "[A-Z][a-zA-Z0-9_]*".
         
        string name = 1;
        Specified by:
        getNameBytes in interface OpDefOrBuilder
        Returns:
        The bytes for name.
      • getInputArgCount

        public int getInputArgCount()
         Description of the input(s).
         
        repeated .tensorflow.OpDef.ArgDef input_arg = 2;
        Specified by:
        getInputArgCount in interface OpDefOrBuilder
      • getInputArg

        public OpDef.ArgDef getInputArg​(int index)
         Description of the input(s).
         
        repeated .tensorflow.OpDef.ArgDef input_arg = 2;
        Specified by:
        getInputArg in interface OpDefOrBuilder
      • getOutputArgCount

        public int getOutputArgCount()
         Description of the output(s).
         
        repeated .tensorflow.OpDef.ArgDef output_arg = 3;
        Specified by:
        getOutputArgCount in interface OpDefOrBuilder
      • getOutputArg

        public OpDef.ArgDef getOutputArg​(int index)
         Description of the output(s).
         
        repeated .tensorflow.OpDef.ArgDef output_arg = 3;
        Specified by:
        getOutputArg in interface OpDefOrBuilder
      • getAttrCount

        public int getAttrCount()
        repeated .tensorflow.OpDef.AttrDef attr = 4;
        Specified by:
        getAttrCount in interface OpDefOrBuilder
      • hasDeprecation

        public boolean hasDeprecation()
         Optional deprecation based on GraphDef versions.
         
        .tensorflow.OpDeprecation deprecation = 8;
        Specified by:
        hasDeprecation in interface OpDefOrBuilder
        Returns:
        Whether the deprecation field is set.
      • getDeprecation

        public OpDeprecation getDeprecation()
         Optional deprecation based on GraphDef versions.
         
        .tensorflow.OpDeprecation deprecation = 8;
        Specified by:
        getDeprecation in interface OpDefOrBuilder
        Returns:
        The deprecation.
      • getSummary

        public String getSummary()
         One-line human-readable description of what the Op does.
         
        string summary = 5;
        Specified by:
        getSummary in interface OpDefOrBuilder
        Returns:
        The summary.
      • getSummaryBytes

        public org.nd4j.shade.protobuf.ByteString getSummaryBytes()
         One-line human-readable description of what the Op does.
         
        string summary = 5;
        Specified by:
        getSummaryBytes in interface OpDefOrBuilder
        Returns:
        The bytes for summary.
      • getDescription

        public String getDescription()
         Additional, longer human-readable description of what the Op does.
         
        string description = 6;
        Specified by:
        getDescription in interface OpDefOrBuilder
        Returns:
        The description.
      • getDescriptionBytes

        public org.nd4j.shade.protobuf.ByteString getDescriptionBytes()
         Additional, longer human-readable description of what the Op does.
         
        string description = 6;
        Specified by:
        getDescriptionBytes in interface OpDefOrBuilder
        Returns:
        The bytes for description.
      • getIsCommutative

        public boolean getIsCommutative()
         True if the operation is commutative ("op(a,b) == op(b,a)" for all inputs)
         
        bool is_commutative = 18;
        Specified by:
        getIsCommutative in interface OpDefOrBuilder
        Returns:
        The isCommutative.
      • getIsAggregate

        public boolean getIsAggregate()
         If is_aggregate is true, then this operation accepts N >= 2
         inputs and produces 1 output all of the same type.  Should be
         associative and commutative, and produce output with the same
         shape as the input.  The optimizer may replace an aggregate op
         taking input from multiple devices with a tree of aggregate ops
         that aggregate locally within each device (and possibly within
         groups of nearby devices) before communicating.
         TODO(josh11b): Implement that optimization.
         
        bool is_aggregate = 16;
        Specified by:
        getIsAggregate in interface OpDefOrBuilder
        Returns:
        The isAggregate.
      • getIsStateful

        public boolean getIsStateful()
         Ops are marked as stateful if their behavior depends on some state beyond
         their input tensors (e.g. variable reading op) or if they have
         a side-effect (e.g. printing or asserting ops). Equivalently, stateless ops
         must always produce the same output for the same input and have
         no side-effects.
         By default Ops may be moved between devices.  Stateful ops should
         either not be moved, or should only be moved if that state can also
         be moved (e.g. via some sort of save / restore).
         Stateful ops are guaranteed to never be optimized away by Common
         Subexpression Elimination (CSE).
         
        bool is_stateful = 17;
        Specified by:
        getIsStateful in interface OpDefOrBuilder
        Returns:
        The isStateful.
      • getAllowsUninitializedInput

        public boolean getAllowsUninitializedInput()
         By default, all inputs to an Op must be initialized Tensors.  Ops
         that may initialize tensors for the first time should set this
         field to true, to allow the Op to take an uninitialized Tensor as
         input.
         
        bool allows_uninitialized_input = 19;
        Specified by:
        getAllowsUninitializedInput in interface OpDefOrBuilder
        Returns:
        The allowsUninitializedInput.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface org.nd4j.shade.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(org.nd4j.shade.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface org.nd4j.shade.protobuf.MessageLite
        Overrides:
        writeTo in class org.nd4j.shade.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface org.nd4j.shade.protobuf.MessageLite
        Overrides:
        getSerializedSize in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface org.nd4j.shade.protobuf.Message
        Overrides:
        equals in class org.nd4j.shade.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface org.nd4j.shade.protobuf.Message
        Overrides:
        hashCode in class org.nd4j.shade.protobuf.AbstractMessage
      • parseFrom

        public static OpDef parseFrom​(ByteBuffer data)
                               throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static OpDef parseFrom​(ByteBuffer data,
                                      org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
                               throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static OpDef parseFrom​(org.nd4j.shade.protobuf.ByteString data)
                               throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static OpDef parseFrom​(org.nd4j.shade.protobuf.ByteString data,
                                      org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
                               throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static OpDef parseFrom​(byte[] data)
                               throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static OpDef parseFrom​(byte[] data,
                                      org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
                               throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static OpDef parseFrom​(org.nd4j.shade.protobuf.CodedInputStream input,
                                      org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
                               throws IOException
        Throws:
        IOException
      • newBuilderForType

        public OpDef.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface org.nd4j.shade.protobuf.Message
        Specified by:
        newBuilderForType in interface org.nd4j.shade.protobuf.MessageLite
      • toBuilder

        public OpDef.Builder toBuilder()
        Specified by:
        toBuilder in interface org.nd4j.shade.protobuf.Message
        Specified by:
        toBuilder in interface org.nd4j.shade.protobuf.MessageLite
      • newBuilderForType

        protected OpDef.Builder newBuilderForType​(org.nd4j.shade.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static OpDef getDefaultInstance()
      • parser

        public static org.nd4j.shade.protobuf.Parser<OpDef> parser()
      • getParserForType

        public org.nd4j.shade.protobuf.Parser<OpDef> getParserForType()
        Specified by:
        getParserForType in interface org.nd4j.shade.protobuf.Message
        Specified by:
        getParserForType in interface org.nd4j.shade.protobuf.MessageLite
        Overrides:
        getParserForType in class org.nd4j.shade.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

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