# OnnxSparseTensor.CSRCTensor (onnxruntime 1.15.0 API)

Package ai.onnxruntime

## Class OnnxSparseTensor.CSRCTensor

- java.lang.Object
- - ai.onnxruntime.OnnxSparseTensor.SparseTensor<java.nio.LongBuffer>
  - - ai.onnxruntime.OnnxSparseTensor.CSRCTensor

Enclosing class:
  OnnxSparseTensor

    public static final class OnnxSparseTensor.CSRCTensor
    extends OnnxSparseTensor.SparseTensor<java.nio.LongBuffer>

The Java side representation of a CSRC sparse tensor.

### Constructor Summary

Constructors
`CSRCTensor​(java.nio.LongBuffer outerIndices, java.nio.LongBuffer innerIndices, java.nio.Buffer values, long[] denseShape, OnnxJavaType type, long numNonZero)` Creates a CSRC sparse tensor suitable for constructing an ORT Sparse Tensor.

### Method Summary

All Methods Instance Methods Concrete Methods
`OnnxJavaType` `getIndicesType()` The indices type of the sparse tensor.
`java.nio.LongBuffer` `getInnerIndices()` Gets the inner indices buffer.
`long[]` `getInnerIndicesShape()` Gets the shape of the inner indices.
`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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CSRCTensor

    public CSRCTensor​(java.nio.LongBuffer outerIndices,
                      java.nio.LongBuffer innerIndices,
                      java.nio.Buffer values,
                      long[] denseShape,
                      OnnxJavaType type,
                      long numNonZero)

Creates a CSRC sparse tensor suitable for constructing an ORT Sparse Tensor.

Parameters:
  `outerIndices` - The outer indices.
  `innerIndices` - The inner indices.
  `values` - The data.
  `denseShape` - The dense shape.
  `type` - The data type.
  `numNonZero` - The number of non-zero elements.

### Method Detail

#### getInnerIndicesShape

    public long[] getInnerIndicesShape()

Gets the shape of the inner indices.

Returns:
  The inner indices shape.

#### getInnerIndices

    public java.nio.LongBuffer getInnerIndices()

Gets the inner indices buffer.

Returns:
  The inner indices buffer.

#### getIndicesType

    public OnnxJavaType getIndicesType()

Description copied from class: `OnnxSparseTensor.SparseTensor`
The indices type of the sparse tensor.

Only `OnnxJavaType.INT32` and `OnnxJavaType.INT64` are supported.

Specified by:
  `getIndicesType` in class `OnnxSparseTensor.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 class `OnnxSparseTensor.SparseTensor<java.nio.LongBuffer>`
Returns:
  The sparse tensor sparsity type.