pub trait SparseTensorOps:
Clone
+ Send
+ Sync
+ TensorBase {
// Required methods
fn nnz(&self) -> usize;
fn coo(&self) -> COOView<'_>;
fn row_indices(&self) -> &[usize];
fn col_indices(&self) -> &[usize];
fn values(&self) -> &DenseTensor;
// Provided method
fn sparsity(&self) -> f64 { ... }
}Expand description
稀疏张量操作 trait
Required Methods§
Sourcefn row_indices(&self) -> &[usize]
fn row_indices(&self) -> &[usize]
获取行索引
Sourcefn col_indices(&self) -> &[usize]
fn col_indices(&self) -> &[usize]
获取列索引
Sourcefn values(&self) -> &DenseTensor
fn values(&self) -> &DenseTensor
获取非零值(作为 DenseTensor)
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl SparseTensorOps for SparseTensor
Available on crate feature
tensor only.