Struct tc_tensor::SparseTensor
source · [−]pub struct SparseTensor<FD, FS, D, T, A> { /* private fields */ }
Expand description
A Tensor
stored as a Table
of Coord
s and [Number
] values
Implementations
sourceimpl<FD, FS, D, T, A> SparseTensor<FD, FS, D, T, A>
impl<FD, FS, D, T, A> SparseTensor<FD, FS, D, T, A>
sourcepub fn into_inner(self) -> A
pub fn into_inner(self) -> A
Consume this SparseTensor
and return its accessor.
sourceimpl<FD, FS, D, T> SparseTensor<FD, FS, D, T, SparseTable<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<BTreeType> + From<TensorType>,
impl<FD, FS, D, T> SparseTensor<FD, FS, D, T, SparseTable<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<BTreeType> + From<TensorType>,
sourcepub async fn create(dir: &D, schema: Schema, txn_id: TxnId) -> TCResult<Self>
pub async fn create(dir: &D, schema: Schema, txn_id: TxnId) -> TCResult<Self>
Create a new SparseTensor
with the given schema
sourcepub async fn tile(
txn: T,
tensor: SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>,
multiples: Vec<u64>
) -> TCResult<Self>
pub async fn tile(
txn: T,
tensor: SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>,
multiples: Vec<u64>
) -> TCResult<Self>
Tile the given tensor
into a new SparseTensor
Trait Implementations
sourceimpl<FD: Clone, FS: Clone, D: Clone, T: Clone, A: Clone> Clone for SparseTensor<FD, FS, D, T, A>
impl<FD: Clone, FS: Clone, D: Clone, T: Clone, A: Clone> Clone for SparseTensor<FD, FS, D, T, A>
sourcefn clone(&self) -> SparseTensor<FD, FS, D, T, A>
fn clone(&self) -> SparseTensor<FD, FS, D, T, A>
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, A> CopyFrom<D, SparseTensor<FD, FS, D, T, A>> for SparseTable<FD, FS, D, T> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
A: SparseAccess<FD, FS, D, T>,
D::FileClass: From<BTreeType> + From<TensorType>,
impl<FD, FS, D, T, A> CopyFrom<D, SparseTensor<FD, FS, D, T, A>> for SparseTable<FD, FS, D, T> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
A: SparseAccess<FD, FS, D, T>,
D::FileClass: From<BTreeType> + From<TensorType>,
sourceimpl<FD, FS, D, T, A> CopyFrom<D, SparseTensor<FD, FS, D, T, A>> for SparseTensor<FD, FS, D, T, SparseTable<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<BTreeType> + From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, A> CopyFrom<D, SparseTensor<FD, FS, D, T, A>> for SparseTensor<FD, FS, D, T, SparseTable<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<BTreeType> + From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
sourcefn copy_from<'life0, 'async_trait>(
instance: SparseTensor<FD, FS, D, T, A>,
store: Self::Store,
txn: &'life0 Self::Txn
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn copy_from<'life0, 'async_trait>(
instance: SparseTensor<FD, FS, D, T, A>,
store: Self::Store,
txn: &'life0 Self::Txn
) -> Pin<Box<dyn Future<Output = TCResult<Self>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Copy a new instance of Self
from an existing instance.
sourceimpl<FD, FS, D, T, A> Display for SparseTensor<FD, FS, D, T, A>
impl<FD, FS, D, T, A> Display for SparseTensor<FD, FS, D, T, A>
sourceimpl<FD, FS, D, T, A> From<A> for SparseTensor<FD, FS, D, T, A>
impl<FD, FS, D, T, A> From<A> for SparseTensor<FD, FS, D, T, A>
sourceimpl<FD, FS, D, T, A> From<SparseTensor<FD, FS, D, T, A>> for Tensor<FD, FS, D, T> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
A: SparseAccess<FD, FS, D, T>,
D::FileClass: From<TensorType>,
impl<FD, FS, D, T, A> From<SparseTensor<FD, FS, D, T, A>> for Tensor<FD, FS, D, T> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
A: SparseAccess<FD, FS, D, T>,
D::FileClass: From<TensorType>,
sourcefn from(sparse: SparseTensor<FD, FS, D, T, A>) -> Self
fn from(sparse: SparseTensor<FD, FS, D, T, A>) -> Self
Converts to this type from the input type.
sourceimpl<FD, FS, D, T> FromStream for SparseTensor<FD, FS, D, T, SparseTable<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<BTreeType> + From<TensorType>,
impl<FD, FS, D, T> FromStream for SparseTensor<FD, FS, D, T, SparseTable<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<BTreeType> + From<TensorType>,
type Context = T
type Context = T
The decoding context of this type, useful in situations where the stream to be decoded may be too large to hold in main memory. Read more
sourcefn from_stream<'life0, 'async_trait, De>(
txn: T,
decoder: &'life0 mut De
) -> Pin<Box<dyn Future<Output = Result<Self, De::Error>> + Send + 'async_trait>> where
De: 'async_trait + Decoder,
'life0: 'async_trait,
Self: 'async_trait,
fn from_stream<'life0, 'async_trait, De>(
txn: T,
decoder: &'life0 mut De
) -> Pin<Box<dyn Future<Output = Result<Self, De::Error>> + Send + 'async_trait>> where
De: 'async_trait + Decoder,
'life0: 'async_trait,
Self: 'async_trait,
Parse this value using the given Decoder
.
sourceimpl<FD, FS, D, T, A> Instance for SparseTensor<FD, FS, D, T, A> where
Self: Send + Sync,
impl<FD, FS, D, T, A> Instance for SparseTensor<FD, FS, D, T, A> where
Self: Send + Sync,
sourceimpl<'en, FD, FS, D, T, A> IntoView<'en, D> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
impl<'en, FD, FS, D, T, A> IntoView<'en, D> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
sourceimpl<FD, FS, D, T> Persist<D> for SparseTensor<FD, FS, D, T, SparseTable<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<BTreeType> + From<TensorType>,
impl<FD, FS, D, T> Persist<D> for SparseTensor<FD, FS, D, T, SparseTable<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<BTreeType> + From<TensorType>,
sourceimpl<FD, FS, D, T> Restore<D> for SparseTensor<FD, FS, D, T, SparseTable<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<BTreeType> + From<TensorType>,
impl<FD, FS, D, T> Restore<D> for SparseTensor<FD, FS, D, T, SparseTable<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<BTreeType> + From<TensorType>,
sourceimpl<FD, FS, D, T, A> TensorAccess for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, A> TensorAccess for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
sourceimpl<FD, FS, D, T, L, R> TensorBoolean<SparseTensor<FD, FS, D, T, R>> for SparseTensor<FD, FS, D, T, L> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
L: SparseAccess<FD, FS, D, T>,
R: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, L, R> TensorBoolean<SparseTensor<FD, FS, D, T, R>> for SparseTensor<FD, FS, D, T, L> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
L: SparseAccess<FD, FS, D, T>,
R: SparseAccess<FD, FS, D, T>,
type Combine = SparseTensor<FD, FS, D, T, SparseCombinator<FD, FS, D, T, L, R>>
type Combine = SparseTensor<FD, FS, D, T, SparseCombinator<FD, FS, D, T, L, R>>
The result type of a boolean operation.
type LeftCombine = SparseTensor<FD, FS, D, T, SparseLeftCombinator<FD, FS, D, T, L, R>>
type LeftCombine = SparseTensor<FD, FS, D, T, SparseLeftCombinator<FD, FS, D, T, L, R>>
The result type of a boolean operation which may ignore right-hand values.
sourcefn and(
self,
other: SparseTensor<FD, FS, D, T, R>
) -> TCResult<Self::LeftCombine>
fn and(
self,
other: SparseTensor<FD, FS, D, T, R>
) -> TCResult<Self::LeftCombine>
Logical and
sourcefn or(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Combine>
fn or(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Combine>
Logical or
sourcefn xor(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Combine>
fn xor(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Combine>
Logical xor
sourceimpl<FD, FS, D, T, A> TensorBoolean<Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, A> TensorBoolean<Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
type LeftCombine = Tensor<FD, FS, D, T>
type LeftCombine = Tensor<FD, FS, D, T>
The result type of a boolean operation which may ignore right-hand values.
sourceimpl<FD, FS, D, T, A> TensorBooleanConst for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
Self: TensorInstance,
<Self as TensorInstance>::Dense: TensorBooleanConst,
impl<FD, FS, D, T, A> TensorBooleanConst for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
Self: TensorInstance,
<Self as TensorInstance>::Dense: TensorBooleanConst,
type Combine = SparseTensor<FD, FS, D, T, SparseConstCombinator<FD, FS, D, T, A>>
type Combine = SparseTensor<FD, FS, D, T, SparseConstCombinator<FD, FS, D, T, A>>
The return type of a boolean operation.
type DenseCombine = <<SparseTensor<FD, FS, D, T, A> as TensorInstance>::Dense as TensorBooleanConst>::DenseCombine
type DenseCombine = <<SparseTensor<FD, FS, D, T, A> as TensorInstance>::Dense as TensorBooleanConst>::DenseCombine
The return type of a boolean operation with a result expected to be dense.
sourcefn or_const(self, other: Number) -> TCResult<Self::DenseCombine>
fn or_const(self, other: Number) -> TCResult<Self::DenseCombine>
Logical or
sourcefn xor_const(self, other: Number) -> TCResult<Self::DenseCombine>
fn xor_const(self, other: Number) -> TCResult<Self::DenseCombine>
Logical xor
sourceimpl<FD, FS, D, T, L, R> TensorCompare<SparseTensor<FD, FS, D, T, R>> for SparseTensor<FD, FS, D, T, L> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
L: SparseAccess<FD, FS, D, T>,
R: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, L, R> TensorCompare<SparseTensor<FD, FS, D, T, R>> for SparseTensor<FD, FS, D, T, L> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
L: SparseAccess<FD, FS, D, T>,
R: SparseAccess<FD, FS, D, T>,
type Compare = SparseTensor<FD, FS, D, T, SparseCombinator<FD, FS, D, T, L, R>>
type Compare = SparseTensor<FD, FS, D, T, SparseCombinator<FD, FS, D, T, L, R>>
The result of a comparison operation
type Dense = DenseTensor<FD, FS, D, T, BlockListSparse<FD, FS, D, T, SparseCombinator<FD, FS, D, T, L, R>>>
type Dense = DenseTensor<FD, FS, D, T, BlockListSparse<FD, FS, D, T, SparseCombinator<FD, FS, D, T, L, R>>>
The result of a comparison operation which can only return a dense Tensor
sourcefn eq(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Dense>
fn eq(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Dense>
Element-wise equality
sourcefn gt(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Compare>
fn gt(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Compare>
Element-wise greater-than
sourcefn gte(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Dense>
fn gte(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Dense>
Element-wise greater-or-equal
sourcefn lt(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Compare>
fn lt(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Compare>
Element-wise less-than
sourcefn lte(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Dense>
fn lte(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Dense>
Element-wise less-or-equal
sourcefn ne(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Compare>
fn ne(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Compare>
Element-wise not-equal
sourceimpl<FD, FS, D, T, A> TensorCompare<Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, A> TensorCompare<Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
sourceimpl<FD, FS, D, T, A> TensorCompareConst for SparseTensor<FD, FS, D, T, A>
impl<FD, FS, D, T, A> TensorCompareConst for SparseTensor<FD, FS, D, T, A>
type Compare = SparseTensor<FD, FS, D, T, SparseConstCombinator<FD, FS, D, T, A>>
type Compare = SparseTensor<FD, FS, D, T, SparseConstCombinator<FD, FS, D, T, A>>
The result of a comparison operation
sourceimpl<FD, FS, D, T, A> TensorDiagonal<D> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
A: SparseAccess<FD, FS, D, T>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<BTreeType> + From<TensorType>,
SparseTable<FD, FS, D, T>: ReadValueAt<D, Txn = T>,
impl<FD, FS, D, T, A> TensorDiagonal<D> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
A: SparseAccess<FD, FS, D, T>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<BTreeType> + From<TensorType>,
SparseTable<FD, FS, D, T>: ReadValueAt<D, Txn = T>,
type Txn = T
type Txn = T
The type of Transaction
to expect
type Diagonal = SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>
type Diagonal = SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>
The type of Tensor
returned by diagonal
fn diagonal<'async_trait>(
self,
txn: Self::Txn
) -> Pin<Box<dyn Future<Output = TCResult<Self::Diagonal>> + Send + 'async_trait>> where
Self: 'async_trait,
sourceimpl<FD, FS, D, T, L> TensorDualIO<D, SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>> for SparseTensor<FD, FS, D, T, L> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
L: SparseWrite<FD, FS, D, T>,
impl<FD, FS, D, T, L> TensorDualIO<D, SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>> for SparseTensor<FD, FS, D, T, L> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
L: SparseWrite<FD, FS, D, T>,
type Txn = T
type Txn = T
The type of Transaction
to expect
sourceimpl<FD, FS, D, T, A> TensorDualIO<D, Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<BTreeType> + From<TensorType>,
A: SparseWrite<FD, FS, D, T>,
impl<FD, FS, D, T, A> TensorDualIO<D, Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<BTreeType> + From<TensorType>,
A: SparseWrite<FD, FS, D, T>,
type Txn = T
type Txn = T
The type of Transaction
to expect
sourceimpl<FD, FS, D, T, A> TensorIO<D> for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseWrite<FD, FS, D, T>,
impl<FD, FS, D, T, A> TensorIO<D> for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseWrite<FD, FS, D, T>,
type Txn = T
type Txn = T
The type of Transaction
to expect
sourcefn read_value<'async_trait>(
self,
txn: Self::Txn,
coord: Coord
) -> Pin<Box<dyn Future<Output = TCResult<Number>> + Send + 'async_trait>> where
Self: 'async_trait,
fn read_value<'async_trait>(
self,
txn: Self::Txn,
coord: Coord
) -> Pin<Box<dyn Future<Output = TCResult<Number>> + Send + 'async_trait>> where
Self: 'async_trait,
Read a single value from this Tensor
.
sourceimpl<FD, FS, D, T, A> TensorIndex<D> for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseWrite<FD, FS, D, T>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<BTreeType> + From<TensorType>,
impl<FD, FS, D, T, A> TensorIndex<D> for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseWrite<FD, FS, D, T>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<BTreeType> + From<TensorType>,
type Txn = T
type Txn = T
The type of Transaction
to expect
type Index = SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>
type Index = SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>
The type of Tensor
returned by argmax
.
sourceimpl<FD, FS, D, T, A> TensorInstance for SparseTensor<FD, FS, D, T, A>
impl<FD, FS, D, T, A> TensorInstance for SparseTensor<FD, FS, D, T, A>
type Dense = DenseTensor<FD, FS, D, T, BlockListSparse<FD, FS, D, T, A>>
type Dense = DenseTensor<FD, FS, D, T, BlockListSparse<FD, FS, D, T, A>>
A dense representation of this Tensor
type Sparse = SparseTensor<FD, FS, D, T, A>
type Sparse = SparseTensor<FD, FS, D, T, A>
A sparse representation of this Tensor
sourcefn into_dense(self) -> Self::Dense
fn into_dense(self) -> Self::Dense
Return a dense representation of this Tensor
.
sourcefn into_sparse(self) -> Self::Sparse
fn into_sparse(self) -> Self::Sparse
Return a sparse representation of this Tensor
.
sourceimpl<FD, FS, D, T, L, R> TensorMath<D, SparseTensor<FD, FS, D, T, R>> for SparseTensor<FD, FS, D, T, L> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
L: SparseAccess<FD, FS, D, T>,
R: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, L, R> TensorMath<D, SparseTensor<FD, FS, D, T, R>> for SparseTensor<FD, FS, D, T, L> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
L: SparseAccess<FD, FS, D, T>,
R: SparseAccess<FD, FS, D, T>,
type Combine = SparseTensor<FD, FS, D, T, SparseCombinator<FD, FS, D, T, L, R>>
type Combine = SparseTensor<FD, FS, D, T, SparseCombinator<FD, FS, D, T, L, R>>
The result type of a math operation
type LeftCombine = SparseTensor<FD, FS, D, T, SparseLeftCombinator<FD, FS, D, T, L, R>>
type LeftCombine = SparseTensor<FD, FS, D, T, SparseLeftCombinator<FD, FS, D, T, L, R>>
The result type of a math operation which may ignore right-hand-side values
sourcefn add(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Combine>
fn add(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Combine>
Add two tensors together.
sourcefn div(
self,
other: SparseTensor<FD, FS, D, T, R>
) -> TCResult<Self::LeftCombine>
fn div(
self,
other: SparseTensor<FD, FS, D, T, R>
) -> TCResult<Self::LeftCombine>
Divide self
by other
.
sourcefn log(self, base: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::LeftCombine>
fn log(self, base: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::LeftCombine>
Element-wise logarithm of self
with respect to the given base
.
sourcefn mul(
self,
other: SparseTensor<FD, FS, D, T, R>
) -> TCResult<Self::LeftCombine>
fn mul(
self,
other: SparseTensor<FD, FS, D, T, R>
) -> TCResult<Self::LeftCombine>
Multiply two tensors together.
sourcefn pow(
self,
other: SparseTensor<FD, FS, D, T, R>
) -> TCResult<Self::LeftCombine>
fn pow(
self,
other: SparseTensor<FD, FS, D, T, R>
) -> TCResult<Self::LeftCombine>
Raise self
to the power of other
.
sourcefn sub(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Combine>
fn sub(self, other: SparseTensor<FD, FS, D, T, R>) -> TCResult<Self::Combine>
Subtract other
from self
.
sourceimpl<FD, FS, D, T, A> TensorMath<D, Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, A> TensorMath<D, Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
type LeftCombine = Tensor<FD, FS, D, T>
type LeftCombine = Tensor<FD, FS, D, T>
The result type of a math operation which may ignore right-hand-side values
sourcefn log(self, base: Tensor<FD, FS, D, T>) -> TCResult<Self::LeftCombine>
fn log(self, base: Tensor<FD, FS, D, T>) -> TCResult<Self::LeftCombine>
Element-wise logarithm of self
with respect to the given base
.
sourcefn mul(self, other: Tensor<FD, FS, D, T>) -> TCResult<Self::Combine>
fn mul(self, other: Tensor<FD, FS, D, T>) -> TCResult<Self::Combine>
Multiply two tensors together.
sourceimpl<FD, FS, D, T, A> TensorMathConst for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
Self: TensorInstance,
<Self as TensorInstance>::Dense: TensorMathConst,
impl<FD, FS, D, T, A> TensorMathConst for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
Self: TensorInstance,
<Self as TensorInstance>::Dense: TensorMathConst,
type Combine = SparseTensor<FD, FS, D, T, SparseConstCombinator<FD, FS, D, T, A>>
type Combine = SparseTensor<FD, FS, D, T, SparseConstCombinator<FD, FS, D, T, A>>
The return type of a math operation
type DenseCombine = <<SparseTensor<FD, FS, D, T, A> as TensorInstance>::Dense as TensorMathConst>::DenseCombine
type DenseCombine = <<SparseTensor<FD, FS, D, T, A> as TensorInstance>::Dense as TensorMathConst>::DenseCombine
The return type of a math operation with a result expected to be dense
sourcefn add_const(self, other: Number) -> TCResult<Self::DenseCombine>
fn add_const(self, other: Number) -> TCResult<Self::DenseCombine>
Add a constant to this tensor
sourcefn sub_const(self, other: Number) -> TCResult<Self::DenseCombine>
fn sub_const(self, other: Number) -> TCResult<Self::DenseCombine>
Subtract other
from self
.
sourceimpl<FD, FS, D, T> TensorPersist for SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>
impl<FD, FS, D, T> TensorPersist for SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>
type Persistent = SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>
fn as_persistent(self) -> Option<Self::Persistent>
sourceimpl<FD, FS, D, T, A> TensorReduce<D> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
Self: TensorInstance,
<Self as TensorInstance>::Dense: TensorReduce<D, Txn = T> + Send + Sync,
impl<FD, FS, D, T, A> TensorReduce<D> for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
Self: TensorInstance,
<Self as TensorInstance>::Dense: TensorReduce<D, Txn = T> + Send + Sync,
type Txn = T
type Txn = T
The type of Transaction
to expect
type Reduce = SparseTensor<FD, FS, D, T, SparseReduce<FD, FS, D, T>>
type Reduce = SparseTensor<FD, FS, D, T, SparseReduce<FD, FS, D, T>>
The result type of a reduce operation
sourcefn max(self, axis: usize, keepdims: bool) -> TCResult<Self::Reduce>
fn max(self, axis: usize, keepdims: bool) -> TCResult<Self::Reduce>
Return the maximum of this Tensor
along the given axis
.
sourcefn max_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>
fn max_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>
Return the maximum element in this Tensor
.
sourcefn min(self, axis: usize, keepdims: bool) -> TCResult<Self::Reduce>
fn min(self, axis: usize, keepdims: bool) -> TCResult<Self::Reduce>
Return the minimum of this Tensor
along the given axis
.
sourcefn min_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>
fn min_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>
Return the minimum element in this Tensor
.
sourcefn product(self, axis: usize, keepdims: bool) -> TCResult<Self::Reduce>
fn product(self, axis: usize, keepdims: bool) -> TCResult<Self::Reduce>
Return the product of this Tensor
along the given axis
.
sourcefn product_all(&self, txn: T) -> TCBoxTryFuture<'_, Number>
fn product_all(&self, txn: T) -> TCBoxTryFuture<'_, Number>
Return the product of all elements in this Tensor
.
sourcefn sum(self, axis: usize, keepdims: bool) -> TCResult<Self::Reduce>
fn sum(self, axis: usize, keepdims: bool) -> TCResult<Self::Reduce>
Return the sum of this Tensor
along the given axis
.
sourcefn sum_all(&self, txn: T) -> TCBoxTryFuture<'_, Number>
fn sum_all(&self, txn: T) -> TCBoxTryFuture<'_, Number>
Return the sum of all elements in this Tensor
.
sourceimpl<FD, FS, D, T, A> TensorTransform for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, A> TensorTransform for SparseTensor<FD, FS, D, T, A> where
D: Dir,
T: Transaction<D>,
FD: File<Array>,
FS: File<Node>,
D::File: AsType<FD> + AsType<FS>,
D::FileClass: From<TensorType>,
A: SparseAccess<FD, FS, D, T>,
type Broadcast = SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>
type Broadcast = SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>
A broadcast Tensor
type Cast = SparseTensor<FD, FS, D, T, SparseCast<FD, FS, D, T, A>>
type Cast = SparseTensor<FD, FS, D, T, SparseCast<FD, FS, D, T, A>>
A type-cast Tensor
type Expand = SparseTensor<FD, FS, D, T, SparseExpand<FD, FS, D, T, A>>
type Expand = SparseTensor<FD, FS, D, T, SparseExpand<FD, FS, D, T, A>>
A Tensor
with an expanded dimension
type Flip = SparseTensor<FD, FS, D, T, SparseFlip<FD, FS, D, T, A>>
type Flip = SparseTensor<FD, FS, D, T, SparseFlip<FD, FS, D, T, A>>
A Tensor
flipped around one axis
type Reshape = SparseTensor<FD, FS, D, T, SparseReshape<FD, FS, D, T, A>>
type Reshape = SparseTensor<FD, FS, D, T, SparseReshape<FD, FS, D, T, A>>
A reshaped Tensor
type Slice = SparseTensor<FD, FS, D, T, <A as SparseAccess<FD, FS, D, T>>::Slice>
type Slice = SparseTensor<FD, FS, D, T, <A as SparseAccess<FD, FS, D, T>>::Slice>
A Tensor
slice
type Transpose = SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>
type Transpose = SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>
A transposed Tensor
sourcefn broadcast(self, shape: Shape) -> TCResult<Self::Broadcast>
fn broadcast(self, shape: Shape) -> TCResult<Self::Broadcast>
Broadcast this Tensor
to the given shape
.
sourcefn cast_into(self, dtype: NumberType) -> TCResult<Self::Cast>
fn cast_into(self, dtype: NumberType) -> TCResult<Self::Cast>
Cast this Tensor
to the given dtype
.
sourcefn expand_dims(self, axis: usize) -> TCResult<Self::Expand>
fn expand_dims(self, axis: usize) -> TCResult<Self::Expand>
Insert a new dimension of size 1 at the given axis
.
sourceimpl<FD, FS, D, T, A> TensorTrig for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, A> TensorTrig for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
type Unary = SparseTensor<FD, FS, D, T, SparseUnary<FD, FS, D, T>>
type Unary = SparseTensor<FD, FS, D, T, SparseUnary<FD, FS, D, T>>
The return type of a unary operation
sourceimpl<FD, FS, D, T, A> TensorUnary<D> for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, A> TensorUnary<D> for SparseTensor<FD, FS, D, T, A> where
FD: File<Array>,
FS: File<Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
type Txn = T
type Txn = T
The type of Transaction
to expect
type Unary = SparseTensor<FD, FS, D, T, SparseUnary<FD, FS, D, T>>
type Unary = SparseTensor<FD, FS, D, T, SparseUnary<FD, FS, D, T>>
The return type of a unary operation
sourcefn all<'async_trait>(
self,
txn: Self::Txn
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>> where
Self: 'async_trait,
fn all<'async_trait>(
self,
txn: Self::Txn
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>> where
Self: 'async_trait,
Return true
if all elements in this Tensor
are nonzero.
sourceimpl<FD, FS, D, T> Transact for SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>> where
Self: Send + Sync,
SparseTable<FD, FS, D, T>: Transact + Send + Sync,
impl<FD, FS, D, T> Transact for SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>> where
Self: Send + Sync,
SparseTable<FD, FS, D, T>: Transact + Send + Sync,
Auto Trait Implementations
impl<FD, FS, D, T, A> RefUnwindSafe for SparseTensor<FD, FS, D, T, A> where
A: RefUnwindSafe,
D: RefUnwindSafe,
FD: RefUnwindSafe,
FS: RefUnwindSafe,
T: RefUnwindSafe,
impl<FD, FS, D, T, A> Send for SparseTensor<FD, FS, D, T, A> where
A: Send,
D: Send,
FD: Send,
FS: Send,
T: Send,
impl<FD, FS, D, T, A> Sync for SparseTensor<FD, FS, D, T, A> where
A: Sync,
D: Sync,
FD: Sync,
FS: Sync,
T: Sync,
impl<FD, FS, D, T, A> Unpin for SparseTensor<FD, FS, D, T, A> where
A: Unpin,
D: Unpin,
FD: Unpin,
FS: Unpin,
T: Unpin,
impl<FD, FS, D, T, A> UnwindSafe for SparseTensor<FD, FS, D, T, A> where
A: UnwindSafe,
D: UnwindSafe,
FD: UnwindSafe,
FS: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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) -> bool where
T: TryCastFrom<Self>,
fn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
Returns true
if self
can be cast into the target type T
.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for T where
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 F where
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for F where
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
.