Package onnx

Class OnnxMl.SparseTensorProto

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

    public static final class OnnxMl.SparseTensorProto
    extends org.nd4j.shade.protobuf.GeneratedMessageV3
    implements OnnxMl.SparseTensorProtoOrBuilder
     A serialized sparse-tensor value
     
    Protobuf type onnx.SparseTensorProto
    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
      • hasValues

        public boolean hasValues()
         The sequence of non-default values are encoded as a tensor of shape [NNZ].
         The default-value is zero for numeric tensors, and empty-string for string tensors.
         values must have a non-empty name present which serves as a name for SparseTensorProto
         when used in sparse_initializer list.
         
        .onnx.TensorProto values = 1;
        Specified by:
        hasValues in interface OnnxMl.SparseTensorProtoOrBuilder
        Returns:
        Whether the values field is set.
      • getValues

        public OnnxMl.TensorProto getValues()
         The sequence of non-default values are encoded as a tensor of shape [NNZ].
         The default-value is zero for numeric tensors, and empty-string for string tensors.
         values must have a non-empty name present which serves as a name for SparseTensorProto
         when used in sparse_initializer list.
         
        .onnx.TensorProto values = 1;
        Specified by:
        getValues in interface OnnxMl.SparseTensorProtoOrBuilder
        Returns:
        The values.
      • getValuesOrBuilder

        public OnnxMl.TensorProtoOrBuilder getValuesOrBuilder()
         The sequence of non-default values are encoded as a tensor of shape [NNZ].
         The default-value is zero for numeric tensors, and empty-string for string tensors.
         values must have a non-empty name present which serves as a name for SparseTensorProto
         when used in sparse_initializer list.
         
        .onnx.TensorProto values = 1;
        Specified by:
        getValuesOrBuilder in interface OnnxMl.SparseTensorProtoOrBuilder
      • hasIndices

        public boolean hasIndices()
         The indices of the non-default values, which may be stored in one of two formats.
         (a) Indices can be a tensor of shape [NNZ, rank] with the [i,j]-th value
         corresponding to the j-th index of the i-th value (in the values tensor).
         (b) Indices can be a tensor of shape [NNZ], in which case the i-th value
         must be the linearized-index of the i-th value (in the values tensor).
         The linearized-index can be converted into an index tuple (k_1,...,k_rank)
         using the shape provided below.
         The indices must appear in ascending order without duplication.
         In the first format, the ordering is lexicographic-ordering:
         e.g., index-value [1,4] must appear before [2,1]
         
        .onnx.TensorProto indices = 2;
        Specified by:
        hasIndices in interface OnnxMl.SparseTensorProtoOrBuilder
        Returns:
        Whether the indices field is set.
      • getIndices

        public OnnxMl.TensorProto getIndices()
         The indices of the non-default values, which may be stored in one of two formats.
         (a) Indices can be a tensor of shape [NNZ, rank] with the [i,j]-th value
         corresponding to the j-th index of the i-th value (in the values tensor).
         (b) Indices can be a tensor of shape [NNZ], in which case the i-th value
         must be the linearized-index of the i-th value (in the values tensor).
         The linearized-index can be converted into an index tuple (k_1,...,k_rank)
         using the shape provided below.
         The indices must appear in ascending order without duplication.
         In the first format, the ordering is lexicographic-ordering:
         e.g., index-value [1,4] must appear before [2,1]
         
        .onnx.TensorProto indices = 2;
        Specified by:
        getIndices in interface OnnxMl.SparseTensorProtoOrBuilder
        Returns:
        The indices.
      • getIndicesOrBuilder

        public OnnxMl.TensorProtoOrBuilder getIndicesOrBuilder()
         The indices of the non-default values, which may be stored in one of two formats.
         (a) Indices can be a tensor of shape [NNZ, rank] with the [i,j]-th value
         corresponding to the j-th index of the i-th value (in the values tensor).
         (b) Indices can be a tensor of shape [NNZ], in which case the i-th value
         must be the linearized-index of the i-th value (in the values tensor).
         The linearized-index can be converted into an index tuple (k_1,...,k_rank)
         using the shape provided below.
         The indices must appear in ascending order without duplication.
         In the first format, the ordering is lexicographic-ordering:
         e.g., index-value [1,4] must appear before [2,1]
         
        .onnx.TensorProto indices = 2;
        Specified by:
        getIndicesOrBuilder in interface OnnxMl.SparseTensorProtoOrBuilder
      • getDimsCount

        public int getDimsCount()
         The shape of the underlying dense-tensor: [dim_1, dim_2, ... dim_rank]
         
        repeated int64 dims = 3;
        Specified by:
        getDimsCount in interface OnnxMl.SparseTensorProtoOrBuilder
        Returns:
        The count of dims.
      • getDims

        public long getDims​(int index)
         The shape of the underlying dense-tensor: [dim_1, dim_2, ... dim_rank]
         
        repeated int64 dims = 3;
        Specified by:
        getDims in interface OnnxMl.SparseTensorProtoOrBuilder
        Parameters:
        index - The index of the element to return.
        Returns:
        The dims 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 OnnxMl.SparseTensorProto parseFrom​(ByteBuffer data)
                                                  throws org.nd4j.shade.protobuf.InvalidProtocolBufferException
        Throws:
        org.nd4j.shade.protobuf.InvalidProtocolBufferException
      • parseFrom

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

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

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

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

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

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

        protected OnnxMl.SparseTensorProto.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<OnnxMl.SparseTensorProto> 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 OnnxMl.SparseTensorProto getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface org.nd4j.shade.protobuf.MessageOrBuilder