Package ai.onnxruntime
Class OnnxSparseTensor.SparseTensor<T extends Buffer>
java.lang.Object
ai.onnxruntime.OnnxSparseTensor.SparseTensor<T>
- Type Parameters:
T- The type of the indices buffer.
- Direct Known Subclasses:
OnnxSparseTensor.BlockSparseTensor,OnnxSparseTensor.COOTensor,OnnxSparseTensor.CSRCTensor
- Enclosing class:
- OnnxSparseTensor
Abstract base class for Java sparse tensors
Will be sealed to OnnxSparseTensor.COOTensor, OnnxSparseTensor.CSRCTensor and OnnxSparseTensor.BlockSparseTensor one
day.
-
Method Summary
Modifier and TypeMethodDescriptionlong[]Gets the dense shape of the sparse tensor.Get the indices buffer.long[]Gets the shape of the indices of the sparse tensor.abstract OnnxJavaTypeThe indices type of the sparse tensor.longThe number of non-zero elements.abstract OnnxSparseTensor.SparseTensorTypeThe sparsity type of the sparse tensor.getType()The data type of the sparse tensor.Get the value buffer.long[]Gets the shape of the values of the sparse tensor.
-
Method Details
-
getDenseShape
public long[] getDenseShape()Gets the dense shape of the sparse tensor.- Returns:
- The sparse tensor shape.
-
getType
The data type of the sparse tensor.- Returns:
- The sparse tensor data type.
-
getNumNonZeroElements
public long getNumNonZeroElements()The number of non-zero elements.- Returns:
- The number of non-zero elements.
-
getIndices
Get the indices buffer.- Returns:
- The indices buffer.
-
getValues
Get the value buffer.- Returns:
- The value buffer.
-
getValuesShape
public long[] getValuesShape()Gets the shape of the values of the sparse tensor.- Returns:
- The sparse tensor value shape.
-
getIndicesShape
public long[] getIndicesShape()Gets the shape of the indices of the sparse tensor.- Returns:
- The sparse tensor indices shape.
-
getSparsityType
The sparsity type of the sparse tensor.- Returns:
- The sparse tensor sparsity type.
-
getIndicesType
The indices type of the sparse tensor.Only
OnnxJavaType.INT32andOnnxJavaType.INT64are supported.- Returns:
- The sparse tensor indices type.
-