Package ai.onnxruntime
Class OnnxSparseTensor.COOTensor
- java.lang.Object
-
- ai.onnxruntime.OnnxSparseTensor.SparseTensor<java.nio.LongBuffer>
-
- ai.onnxruntime.OnnxSparseTensor.COOTensor
-
- Enclosing class:
- OnnxSparseTensor
public static final class OnnxSparseTensor.COOTensor extends OnnxSparseTensor.SparseTensor<java.nio.LongBuffer>
The Java side representation of a COO sparse tensor.
-
-
Constructor Summary
Constructors Constructor Description COOTensor(java.nio.LongBuffer indices, long[] indicesShape, java.nio.Buffer values, long[] denseShape, OnnxJavaType type, long numNonZero)
Creates a COO sparse tensor suitable for constructing an ORT Sparse Tensor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OnnxJavaType
getIndicesType()
The indices type of the sparse tensor.OnnxSparseTensor.SparseTensorType
getSparsityType()
The sparsity type of the sparse tensor.-
Methods inherited from class ai.onnxruntime.OnnxSparseTensor.SparseTensor
getDenseShape, getIndices, getIndicesShape, getNumNonZeroElements, getType, getValues, getValuesShape
-
-
-
-
Constructor Detail
-
COOTensor
public COOTensor(java.nio.LongBuffer indices, long[] indicesShape, java.nio.Buffer values, long[] denseShape, OnnxJavaType type, long numNonZero)
Creates a COO sparse tensor suitable for constructing an ORT Sparse Tensor.- Parameters:
indices
- The indices. Should be a 1d vector, or a 2d vector.indicesShape
- The shape of the indices.values
- The data.denseShape
- The dense shape.type
- The data type.numNonZero
- The number of non-zero elements.
-
-
Method Detail
-
getIndicesType
public OnnxJavaType getIndicesType()
Description copied from class:OnnxSparseTensor.SparseTensor
The indices type of the sparse tensor.Only
OnnxJavaType.INT32
andOnnxJavaType.INT64
are supported.- Specified by:
getIndicesType
in classOnnxSparseTensor.SparseTensor<java.nio.LongBuffer>
- Returns:
- The sparse tensor indices type.
-
getSparsityType
public OnnxSparseTensor.SparseTensorType getSparsityType()
Description copied from class:OnnxSparseTensor.SparseTensor
The sparsity type of the sparse tensor.- Specified by:
getSparsityType
in classOnnxSparseTensor.SparseTensor<java.nio.LongBuffer>
- Returns:
- The sparse tensor sparsity type.
-
-