Enum tc_tensor::SparseAccessor
source · [−]pub enum SparseAccessor<FD, FS, D, T> {
Show 14 variants
Broadcast(Box<SparseBroadcast<FD, FS, D, T, Self>>),
Cast(Box<SparseCast<FD, FS, D, T, Self>>),
Combine(Box<SparseCombinator<FD, FS, D, T, Self, Self>>),
CombineConst(Box<SparseConstCombinator<FD, FS, D, T, Self>>),
CombineLeft(Box<SparseLeftCombinator<FD, FS, D, T, Self, Self>>),
Dense(Box<DenseToSparse<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>>),
Expand(Box<SparseExpand<FD, FS, D, T, Self>>),
Flip(Box<SparseFlip<FD, FS, D, T, Self>>),
Slice(SparseTableSlice<FD, FS, D, T>),
Reduce(Box<SparseReduce<FD, FS, D, T>>),
Reshape(Box<SparseReshape<FD, FS, D, T, Self>>),
Table(SparseTable<FD, FS, D, T>),
Transpose(Box<SparseTranspose<FD, FS, D, T, Self>>),
Unary(Box<SparseUnary<FD, FS, D, T>>),
}Expand description
A generic SparseAccess type
Variants
Broadcast(Box<SparseBroadcast<FD, FS, D, T, Self>>)
Cast(Box<SparseCast<FD, FS, D, T, Self>>)
Combine(Box<SparseCombinator<FD, FS, D, T, Self, Self>>)
CombineConst(Box<SparseConstCombinator<FD, FS, D, T, Self>>)
CombineLeft(Box<SparseLeftCombinator<FD, FS, D, T, Self, Self>>)
Dense(Box<DenseToSparse<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>>)
Expand(Box<SparseExpand<FD, FS, D, T, Self>>)
Flip(Box<SparseFlip<FD, FS, D, T, Self>>)
Slice(SparseTableSlice<FD, FS, D, T>)
Reduce(Box<SparseReduce<FD, FS, D, T>>)
Reshape(Box<SparseReshape<FD, FS, D, T, Self>>)
Table(SparseTable<FD, FS, D, T>)
Transpose(Box<SparseTranspose<FD, FS, D, T, Self>>)
Unary(Box<SparseUnary<FD, FS, D, T>>)
Trait Implementations
sourceimpl<FD: Clone, FS: Clone, D: Clone, T: Clone> Clone for SparseAccessor<FD, FS, D, T>
impl<FD: Clone, FS: Clone, D: Clone, T: Clone> Clone for SparseAccessor<FD, FS, D, T>
sourcefn clone(&self) -> SparseAccessor<FD, FS, D, T>
fn clone(&self) -> SparseAccessor<FD, FS, D, T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<FD, FS, D, T> Display for SparseAccessor<FD, FS, D, T>
impl<FD, FS, D, T> Display for SparseAccessor<FD, FS, D, T>
sourceimpl<FD, FS, D, T> SparseAccess<FD, FS, D, T> for SparseAccessor<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
impl<FD, FS, D, T> SparseAccess<FD, FS, D, T> for SparseAccessor<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
type Slice = SparseAccessor<FD, FS, D, T>
type Slice = SparseAccessor<FD, FS, D, T>
The type of a slice of this accessor
sourcefn accessor(self) -> SparseAccessor<FD, FS, D, T>
fn accessor(self) -> SparseAccessor<FD, FS, D, T>
Return this accessor as a SparseAccessor.
sourcefn 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<'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,
Return this SparseTensor’s contents as an ordered stream of (Coord, [Number]) pairs.
sourcefn 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_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,
sourcefn filled_count<'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<u64>> + Send + 'async_trait>>where
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,
Return the number of nonzero values in this SparseTensor.
sourcefn is_empty<'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
fn is_empty<'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
Return true if this SparseTensor contains no elements.
sourceimpl<FD, FS, D, T> SparseWrite<FD, FS, D, T> for SparseAccessor<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
impl<FD, FS, D, T> SparseWrite<FD, FS, D, T> for SparseAccessor<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
sourceimpl<FD, FS, D, T> TensorAccess for SparseAccessor<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
impl<FD, FS, D, T> TensorAccess for SparseAccessor<FD, FS, D, T>where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
<D::Read as DirRead>::FileEntry: AsType<FD> + AsType<FS>,
<D::Write as DirWrite>::FileClass: From<BTreeType> + From<TensorType>,
Auto Trait Implementations
impl<FD, FS, D, T> !RefUnwindSafe for SparseAccessor<FD, FS, D, T>
impl<FD, FS, D, T> Send for SparseAccessor<FD, FS, D, T>where
D: Send + Sync,
FD: Send,
FS: Send + Sync,
T: Send + Sync,
impl<FD, FS, D, T> Sync for SparseAccessor<FD, FS, D, T>where
D: Send + Sync,
FD: Sync,
FS: Send + Sync,
T: Send + Sync,
impl<FD, FS, D, T> Unpin for SparseAccessor<FD, FS, D, T>where
FD: Unpin,
impl<FD, FS, D, T> !UnwindSafe for SparseAccessor<FD, FS, D, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<F> Match for F
impl<F> Match for F
sourcefn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns true if self can be cast into the target type T.
sourceimpl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
sourcefn can_cast_from(&F) -> bool
fn can_cast_from(&F) -> bool
Test if value can be cast into Self.
sourcefn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns Some(Self) if the source value can be cast into Self, otherwise None.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err>where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err>where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self) if the source value can be cast into Self, otherwise calls on_err.
sourceimpl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
sourcefn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if self can be cast into T.
sourcefn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns Some(T) if self can be cast into T, otherwise None.
sourcefn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err>where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T) if self can be cast into T, otherwise calls on_err.