Trait tc_tensor::SparseAccess [−][src]
pub trait SparseAccess<FD: File<Array>, FS: File<Node>, D: Dir, T: Transaction<D>>: Clone + ReadValueAt<D, Txn = T> + TensorAccess + Send + Sync + 'static { type Slice: SparseAccess<FD, FS, D, T>; type Transpose: SparseAccess<FD, FS, D, T>; fn accessor(self) -> SparseAccessor<FD, FS, D, T>; fn filled<'a, 'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<Pin<Box<dyn Stream<Item = TCResult<(Coord, Number)>> + Send + Unpin + 'a>>>> + Send + 'async_trait>>
where
'a: 'async_trait,
Self: 'async_trait; fn filled_at<'a, 'async_trait>(
self,
txn: T,
axes: Vec<usize>
) -> Pin<Box<dyn Future<Output = TCResult<TCBoxTryStream<'a, Coords>>> + Send + 'async_trait>>
where
'a: 'async_trait,
Self: 'async_trait; fn filled_count<'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<u64>> + Send + 'async_trait>>
where
Self: 'async_trait; fn is_empty<'life0, 'life1, 'async_trait>(
&'life0 self,
txn: &'life1 T
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait; fn slice(self, bounds: Bounds) -> TCResult<Self::Slice>; fn transpose(
self,
permutation: Option<Vec<usize>>
) -> TCResult<Self::Transpose>; }
Expand description
Access methods for SparseTensor
data
Associated Types
type Slice: SparseAccess<FD, FS, D, T>
type Slice: SparseAccess<FD, FS, D, T>
The type of a slice of this accessor
type Transpose: SparseAccess<FD, FS, D, T>
type Transpose: SparseAccess<FD, FS, D, T>
The type of a transpose of this accessor
Required methods
fn accessor(self) -> SparseAccessor<FD, FS, D, T>
fn accessor(self) -> SparseAccessor<FD, FS, D, T>
Return this accessor as a SparseAccessor
.
Return this SparseTensor
’s contents as an ordered stream of (Coord
, [Number
]) pairs.
Return an ordered stream of unique Coord
s on the given axes with nonzero values.
TODO: add sort
parameter to make sorting results optional.
Return the number of nonzero values in this SparseTensor
.
Return true
if this SparseTensor
contains only zero values.
Return a slice of this accessor with the given Bounds
.