Package ai.onnx.proto

Class OnnxMl.SparseTensorProto.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderType>
com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>
ai.onnx.proto.OnnxMl.SparseTensorProto.Builder
All Implemented Interfaces:
OnnxMl.SparseTensorProtoOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
OnnxMl.SparseTensorProto

public static final class OnnxMl.SparseTensorProto.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder> implements OnnxMl.SparseTensorProtoOrBuilder
 A serialized sparse-tensor value
 
Protobuf type onnx.SparseTensorProto
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>
    • clear

      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>
    • getDefaultInstanceForType

      public OnnxMl.SparseTensorProto getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public OnnxMl.SparseTensorProto build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public OnnxMl.SparseTensorProto buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • clone

      Specified by:
      clone in interface com.google.protobuf.Message.Builder
      Specified by:
      clone in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clone in class com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>
    • setField

      public OnnxMl.SparseTensorProto.Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      setField in interface com.google.protobuf.Message.Builder
      Overrides:
      setField in class com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>
    • clearField

      public OnnxMl.SparseTensorProto.Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field)
      Specified by:
      clearField in interface com.google.protobuf.Message.Builder
      Overrides:
      clearField in class com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>
    • clearOneof

      public OnnxMl.SparseTensorProto.Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof)
      Specified by:
      clearOneof in interface com.google.protobuf.Message.Builder
      Overrides:
      clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>
    • setRepeatedField

      public OnnxMl.SparseTensorProto.Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, Object value)
      Specified by:
      setRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>
    • addRepeatedField

      public OnnxMl.SparseTensorProto.Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value)
      Specified by:
      addRepeatedField in interface com.google.protobuf.Message.Builder
      Overrides:
      addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>
    • mergeFrom

      public OnnxMl.SparseTensorProto.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<OnnxMl.SparseTensorProto.Builder>
    • mergeFrom

    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>
    • mergeFrom

      public OnnxMl.SparseTensorProto.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<OnnxMl.SparseTensorProto.Builder>
      Throws:
      IOException
    • 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.
       
      optional .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.
       
      optional .onnx.TensorProto values = 1;
      Specified by:
      getValues in interface OnnxMl.SparseTensorProtoOrBuilder
      Returns:
      The values.
    • setValues

       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.
       
      optional .onnx.TensorProto values = 1;
    • setValues

       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.
       
      optional .onnx.TensorProto values = 1;
    • mergeValues

       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.
       
      optional .onnx.TensorProto values = 1;
    • clearValues

      public OnnxMl.SparseTensorProto.Builder clearValues()
       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.
       
      optional .onnx.TensorProto values = 1;
    • getValuesBuilder

      public OnnxMl.TensorProto.Builder getValuesBuilder()
       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.
       
      optional .onnx.TensorProto values = 1;
    • 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.
       
      optional .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]
       
      optional .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]
       
      optional .onnx.TensorProto indices = 2;
      Specified by:
      getIndices in interface OnnxMl.SparseTensorProtoOrBuilder
      Returns:
      The indices.
    • setIndices

       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]
       
      optional .onnx.TensorProto indices = 2;
    • setIndices

      public OnnxMl.SparseTensorProto.Builder setIndices(OnnxMl.TensorProto.Builder builderForValue)
       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]
       
      optional .onnx.TensorProto indices = 2;
    • mergeIndices

       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]
       
      optional .onnx.TensorProto indices = 2;
    • clearIndices

      public OnnxMl.SparseTensorProto.Builder clearIndices()
       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]
       
      optional .onnx.TensorProto indices = 2;
    • getIndicesBuilder

      public OnnxMl.TensorProto.Builder getIndicesBuilder()
       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]
       
      optional .onnx.TensorProto indices = 2;
    • 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]
       
      optional .onnx.TensorProto indices = 2;
      Specified by:
      getIndicesOrBuilder in interface OnnxMl.SparseTensorProtoOrBuilder
    • getDimsList

      public List<Long> getDimsList()
       The shape of the underlying dense-tensor: [dim_1, dim_2, ... dim_rank]
       
      repeated int64 dims = 3;
      Specified by:
      getDimsList in interface OnnxMl.SparseTensorProtoOrBuilder
      Returns:
      A list containing the dims.
    • 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.
    • setDims

      public OnnxMl.SparseTensorProto.Builder setDims(int index, long value)
       The shape of the underlying dense-tensor: [dim_1, dim_2, ... dim_rank]
       
      repeated int64 dims = 3;
      Parameters:
      index - The index to set the value at.
      value - The dims to set.
      Returns:
      This builder for chaining.
    • addDims

      public OnnxMl.SparseTensorProto.Builder addDims(long value)
       The shape of the underlying dense-tensor: [dim_1, dim_2, ... dim_rank]
       
      repeated int64 dims = 3;
      Parameters:
      value - The dims to add.
      Returns:
      This builder for chaining.
    • addAllDims

      public OnnxMl.SparseTensorProto.Builder addAllDims(Iterable<? extends Long> values)
       The shape of the underlying dense-tensor: [dim_1, dim_2, ... dim_rank]
       
      repeated int64 dims = 3;
      Parameters:
      values - The dims to add.
      Returns:
      This builder for chaining.
    • clearDims

       The shape of the underlying dense-tensor: [dim_1, dim_2, ... dim_rank]
       
      repeated int64 dims = 3;
      Returns:
      This builder for chaining.
    • setUnknownFields

      public final OnnxMl.SparseTensorProto.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      setUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>
    • mergeUnknownFields

      public final OnnxMl.SparseTensorProto.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
      Specified by:
      mergeUnknownFields in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<OnnxMl.SparseTensorProto.Builder>