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
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::File: AsType<FD> + AsType<FS>,
D::FileClass: 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::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
type Slice = Self
type Slice = Self
The type of a slice of this accessor
type Transpose = Self
type Transpose = Self
The type of a transpose of this accessor
Return this accessor as a SparseAccessor
.
Return this SparseTensor
’s contents as an ordered stream of (Coord
, [Number
]) pairs.
Return the number of nonzero values in this SparseTensor
.
Return a slice of this accessor with the given Bounds
.
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::File: AsType<FD> + AsType<FS>,
D::FileClass: 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::File: AsType<FD> + AsType<FS>,
D::FileClass: 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::File: AsType<FD> + AsType<FS>,
D::FileClass: 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::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
Auto Trait Implementations
impl<FD, FS, D, T> RefUnwindSafe for SparseAccessor<FD, FS, D, T> where
D: RefUnwindSafe,
FD: RefUnwindSafe,
FS: RefUnwindSafe,
T: RefUnwindSafe,
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> where
D: UnwindSafe + RefUnwindSafe,
FD: UnwindSafe,
FS: UnwindSafe + RefUnwindSafe,
T: UnwindSafe + RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Returns true
if self
can be cast into the target type T
.
Test if value
can be cast into Self
.
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
fn 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
.
Test if self
can be cast into T
.
Returns Some(T)
if self
can be cast into T
, otherwise None
.
fn 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
.