Package onnx

Class Onnx.AttributeProto

  • All Implemented Interfaces:
    Serializable, Onnx.AttributeProtoOrBuilder, org.nd4j.shade.protobuf.Message, org.nd4j.shade.protobuf.MessageLite, org.nd4j.shade.protobuf.MessageLiteOrBuilder, org.nd4j.shade.protobuf.MessageOrBuilder
    Enclosing class:
    Onnx

    public static final class Onnx.AttributeProto
    extends org.nd4j.shade.protobuf.GeneratedMessageV3
    implements Onnx.AttributeProtoOrBuilder
     Attributes
     A named attribute containing either singular float, integer, string, graph,
     and tensor values, or repeated float, integer, string, graph, and tensor values.
     An AttributeProto MUST contain the name field, and *only one* of the
     following content fields, effectively enforcing a C/C++ union equivalent.
     
    Protobuf type onnx.AttributeProto
    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
      • getNameBytes

        public org.nd4j.shade.protobuf.ByteString getNameBytes()
         The name field MUST be present for this version of the IR.
         
        string name = 1;
        Specified by:
        getNameBytes in interface Onnx.AttributeProtoOrBuilder
        Returns:
        The bytes for name.
      • getRefAttrName

        public String getRefAttrName()
         if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function.
         In this case, this AttributeProto does not contain data, and it's a reference of attribute
         in parent scope.
         NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph.
         
        string ref_attr_name = 21;
        Specified by:
        getRefAttrName in interface Onnx.AttributeProtoOrBuilder
        Returns:
        The refAttrName.
      • getRefAttrNameBytes

        public org.nd4j.shade.protobuf.ByteString getRefAttrNameBytes()
         if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function.
         In this case, this AttributeProto does not contain data, and it's a reference of attribute
         in parent scope.
         NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph.
         
        string ref_attr_name = 21;
        Specified by:
        getRefAttrNameBytes in interface Onnx.AttributeProtoOrBuilder
        Returns:
        The bytes for refAttrName.
      • getDocString

        public String getDocString()
         A human-readable documentation for this attribute. Markdown is allowed.
         
        string doc_string = 13;
        Specified by:
        getDocString in interface Onnx.AttributeProtoOrBuilder
        Returns:
        The docString.
      • getDocStringBytes

        public org.nd4j.shade.protobuf.ByteString getDocStringBytes()
         A human-readable documentation for this attribute. Markdown is allowed.
         
        string doc_string = 13;
        Specified by:
        getDocStringBytes in interface Onnx.AttributeProtoOrBuilder
        Returns:
        The bytes for docString.
      • getTypeValue

        public int getTypeValue()
         The type field MUST be present for this version of the IR.
         For 0.0.1 versions of the IR, this field was not defined, and
         implementations needed to use has_field heuristics to determine
         which value field was in use.  For IR_VERSION 0.0.2 or later, this
         field MUST be set and match the f|i|s|t|... field in use.  This
         change was made to accommodate proto3 implementations.
         
        .onnx.AttributeProto.AttributeType type = 20;
        Specified by:
        getTypeValue in interface Onnx.AttributeProtoOrBuilder
        Returns:
        The enum numeric value on the wire for type.
      • getType

        public Onnx.AttributeProto.AttributeType getType()
         The type field MUST be present for this version of the IR.
         For 0.0.1 versions of the IR, this field was not defined, and
         implementations needed to use has_field heuristics to determine
         which value field was in use.  For IR_VERSION 0.0.2 or later, this
         field MUST be set and match the f|i|s|t|... field in use.  This
         change was made to accommodate proto3 implementations.
         
        .onnx.AttributeProto.AttributeType type = 20;
        Specified by:
        getType in interface Onnx.AttributeProtoOrBuilder
        Returns:
        The type.
      • getF

        public float getF()
         Exactly ONE of the following fields must be present for this version of the IR
         
        float f = 2;
        Specified by:
        getF in interface Onnx.AttributeProtoOrBuilder
        Returns:
        The f.
      • getS

        public org.nd4j.shade.protobuf.ByteString getS()
         UTF-8 string
         
        bytes s = 4;
        Specified by:
        getS in interface Onnx.AttributeProtoOrBuilder
        Returns:
        The s.
      • hasT

        public boolean hasT()
         tensor value
         
        .onnx.TensorProto t = 5;
        Specified by:
        hasT in interface Onnx.AttributeProtoOrBuilder
        Returns:
        Whether the t field is set.
      • hasG

        public boolean hasG()
         graph
         
        .onnx.GraphProto g = 6;
        Specified by:
        hasG in interface Onnx.AttributeProtoOrBuilder
        Returns:
        Whether the g field is set.
      • hasSparseTensor

        public boolean hasSparseTensor()
         sparse tensor value
         
        .onnx.SparseTensorProto sparse_tensor = 22;
        Specified by:
        hasSparseTensor in interface Onnx.AttributeProtoOrBuilder
        Returns:
        Whether the sparseTensor field is set.
      • hasTp

        public boolean hasTp()
         Do not use field below, it's deprecated.
         optional ValueProto v = 12;         // value - subsumes everything but graph
         
        .onnx.TypeProto tp = 14;
        Specified by:
        hasTp in interface Onnx.AttributeProtoOrBuilder
        Returns:
        Whether the tp field is set.
      • getTp

        public Onnx.TypeProto getTp()
         Do not use field below, it's deprecated.
         optional ValueProto v = 12;         // value - subsumes everything but graph
         
        .onnx.TypeProto tp = 14;
        Specified by:
        getTp in interface Onnx.AttributeProtoOrBuilder
        Returns:
        The tp.
      • getFloats

        public float getFloats​(int index)
         list of floats
         
        repeated float floats = 7;
        Specified by:
        getFloats in interface Onnx.AttributeProtoOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The floats at the given index.
      • getInts

        public long getInts​(int index)
         list of ints
         
        repeated int64 ints = 8;
        Specified by:
        getInts in interface Onnx.AttributeProtoOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The ints at the given index.
      • getStringsList

        public List<org.nd4j.shade.protobuf.ByteString> getStringsList()
         list of UTF-8 strings
         
        repeated bytes strings = 9;
        Specified by:
        getStringsList in interface Onnx.AttributeProtoOrBuilder
        Returns:
        A list containing the strings.
      • getStrings

        public org.nd4j.shade.protobuf.ByteString getStrings​(int index)
         list of UTF-8 strings
         
        repeated bytes strings = 9;
        Specified by:
        getStrings in interface Onnx.AttributeProtoOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The strings at the given index.
      • 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 Onnx.AttributeProto parseFrom​(ByteBuffer data)
                                             throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

        public static Onnx.AttributeProto 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 Onnx.AttributeProto parseFrom​(byte[] data)
                                             throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

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

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

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

        public org.nd4j.shade.protobuf.Parser<Onnx.AttributeProto> 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 Onnx.AttributeProto getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageOrBuilder