类 OnnxSparseTensor.SparseTensor<T extends java.nio.Buffer>
- java.lang.Object
-
- ai.onnxruntime.OnnxSparseTensor.SparseTensor<T>
-
- 类型参数
T
- 索引缓冲区的类型。
- 封闭类
- OnnxSparseTensor
public abstract static class OnnxSparseTensor.SparseTensor<T extends java.nio.Buffer> extends java.lang.Object
Java 稀疏张量的抽象基类有朝一日将密封为
OnnxSparseTensor.COOTensor
、OnnxSparseTensor.CSRCTensor
和OnnxSparseTensor.BlockSparseTensor
。
-
-
方法摘要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 描述 long[]
getDenseShape()
获取稀疏张量的密集形状。T
getIndices()
获取索引缓冲区。long[]
getIndicesShape()
获取稀疏张量的索引形状。抽象 OnnxJavaType
getIndicesType()
稀疏张量的索引类型。long
getNumNonZeroElements()
非零元素的数量。抽象 OnnxSparseTensor.SparseTensorType
getSparsityType()
稀疏张量的稀疏类型。OnnxJavaType
getType()
稀疏张量的数据类型。java.nio.Buffer
getValues()
获取值缓冲区。long[]
getValuesShape()
获取稀疏张量的值形状。
-
-
-
方法详情
-
getDenseShape
public long[] getDenseShape()
获取稀疏张量的密集形状。- 返回:
- 稀疏张量的形状。
-
getType
public OnnxJavaType getType()
稀疏张量的数据类型。- 返回:
- 稀疏张量的数据类型。
-
getNumNonZeroElements
public long getNumNonZeroElements()
非零元素的数量。- 返回:
- 非零元素的数量。
-
getIndices
public T getIndices()
获取索引缓冲区。- 返回:
- 索引缓冲区。
-
getValues
public java.nio.Buffer getValues()
获取值缓冲区。- 返回:
- 值缓冲区。
-
getValuesShape
public long[] getValuesShape()
获取稀疏张量的值形状。- 返回:
- 稀疏张量的值形状。
-
getIndicesShape
public long[] getIndicesShape()
获取稀疏张量的索引形状。- 返回:
- 稀疏张量的索引形状。
-
getSparsityType
public abstract OnnxSparseTensor.SparseTensorType getSparsityType()
稀疏张量的稀疏类型。- 返回:
- 稀疏张量的稀疏类型。
-
getIndicesType
public abstract OnnxJavaType getIndicesType()
稀疏张量的索引类型。- 返回:
- 稀疏张量的索引类型。
-
-