# OnnxSparseTensor.BlockSparseTensor (onnxruntime 1.15.0 API)

Package ai.onnxruntime

## Class OnnxSparseTensor.BlockSparseTensor

- java.lang.Object
- - ai.onnxruntime.OnnxSparseTensor.SparseTensor<java.nio.IntBuffer>
  - - ai.onnxruntime.OnnxSparseTensor.BlockSparseTensor

Enclosing class:
  OnnxSparseTensor

    public static final class OnnxSparseTensor.BlockSparseTensor
    extends OnnxSparseTensor.SparseTensor<java.nio.IntBuffer>

The Java side representation of a block sparse tensor.

### Constructor Summary

Constructors
`BlockSparseTensor​(java.nio.IntBuffer indices, long[] indicesShape, java.nio.Buffer values, long[] valuesShape, long[] denseShape, OnnxJavaType type, long numNonZero)` Construct a block sparse tensor.

### Method Summary

All Methods Instance Methods Concrete Methods
`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`

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

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

### Constructor Detail

#### BlockSparseTensor

    public BlockSparseTensor​(java.nio.IntBuffer indices,
                             long[] indicesShape,
                             java.nio.Buffer values,
                             long[] valuesShape,
                             long[] denseShape,
                             OnnxJavaType type,
                             long numNonZero)

Construct a block sparse tensor.

Parameters:
  `indices` - The indices.
  `indicesShape` - The shape of the indices.
  `values` - The data.
  `valuesShape` - The shape of 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` and `OnnxJavaType.INT64` are supported.

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