Enum tc_tensor::SparseAccessor [−][src]
pub enum SparseAccessor<FD, FS, D, T> { 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>>), Dense(Box<DenseToSparse<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>>), Expand(Box<SparseExpand<FD, FS, D, T, Self>>), Slice(SparseTableSlice<FD, FS, D, T>), Reduce(Box<SparseReduce<FD, FS, D, T>>), 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
Tuple Fields of Broadcast
0: Box<SparseBroadcast<FD, FS, D, T, Self>>
Tuple Fields of Cast
0: Box<SparseCast<FD, FS, D, T, Self>>
Tuple Fields of Combine
0: Box<SparseCombinator<FD, FS, D, T, Self, Self>>
Tuple Fields of Dense
0: Box<DenseToSparse<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>>
Tuple Fields of Expand
0: Box<SparseExpand<FD, FS, D, T, Self>>
Tuple Fields of Reduce
0: Box<SparseReduce<FD, FS, D, T>>
Tuple Fields of Table
0: SparseTable<FD, FS, D, T>
Tuple Fields of Transpose
0: Box<SparseTranspose<FD, FS, D, T, Self>>
Tuple Fields of Unary
0: 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
FD: File<Array> + TryFrom<D::File, Error = TCError>,
FS: File<Node> + TryFrom<D::File, Error = TCError>,
D: Dir,
T: Transaction<D>,
D::FileClass: From<TensorType>,
impl<FD, FS, D, T> SparseAccess<FD, FS, D, T> for SparseAccessor<FD, FS, D, T> where
FD: File<Array> + TryFrom<D::File, Error = TCError>,
FS: File<Node> + TryFrom<D::File, Error = TCError>,
D: Dir,
T: Transaction<D>,
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 true
if this SparseTensor
contains only zero values.
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
FD: File<Array> + TryFrom<D::File, Error = TCError>,
FS: File<Node> + TryFrom<D::File, Error = TCError>,
D: Dir,
T: Transaction<D>,
D::FileClass: From<TensorType>,
impl<FD, FS, D, T> SparseWrite<FD, FS, D, T> for SparseAccessor<FD, FS, D, T> where
FD: File<Array> + TryFrom<D::File, Error = TCError>,
FS: File<Node> + TryFrom<D::File, Error = TCError>,
D: Dir,
T: Transaction<D>,
D::FileClass: From<TensorType>,
impl<FD, FS, D, T> TensorAccess for SparseAccessor<FD, FS, D, T> where
FD: File<Array> + TryFrom<D::File, Error = TCError>,
FS: File<Node> + TryFrom<D::File, Error = TCError>,
D: Dir,
T: Transaction<D>,
D::FileClass: From<TensorType>,
impl<FD, FS, D, T> TensorAccess for SparseAccessor<FD, FS, D, T> where
FD: File<Array> + TryFrom<D::File, Error = TCError>,
FS: File<Node> + TryFrom<D::File, Error = TCError>,
D: Dir,
T: Transaction<D>,
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: RefUnwindSafe + UnwindSafe,
FD: UnwindSafe,
FS: RefUnwindSafe + UnwindSafe,
T: RefUnwindSafe + UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Returns true
if self
can be cast into the target type T
.
type Output = T
type Output = T
Should always be Self
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
.