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§
source§impl<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.
source§impl<FD, FS, D, T, A> SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
impl<FD, FS, D, T, A> SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
sourcepub fn schema(&self) -> Schema
pub fn schema(&self) -> Schema
Access the schema of this SparseTensor
source§impl<FD, FS, D, T> SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FD> + DirCreateFile<FS>,
D::Store: From<D> + From<FS>,
impl<FD, FS, D, T> SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FD> + DirCreateFile<FS>,
D::Store: From<D> + From<FS>,
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§
source§impl<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>
source§fn 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 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<FD, FS, D, T, A> CopyFrom<D, SparseTensor<FD, FS, D, T, A>> for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
impl<FD, FS, D, T, A> CopyFrom<D, SparseTensor<FD, FS, D, T, A>> for SparseTable<FD, FS, D, T>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
source§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
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
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
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
source§impl<FD, FS, D, T, A> Display for SparseTensor<FD, FS, D, T, A>where
A: TensorAccess,
impl<FD, FS, D, T, A> Display for SparseTensor<FD, FS, D, T, A>where
A: TensorAccess,
source§impl<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>
source§impl<FD, FS, D, T, A> From<SparseTensor<FD, FS, D, T, A>> for Tensor<FD, FS, D, T>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T, A> From<SparseTensor<FD, FS, D, T, A>> for Tensor<FD, FS, D, T>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
source§fn 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.
source§impl<FD, FS, D, T> FromStream for SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<D> + From<FS>,
impl<FD, FS, D, T> FromStream for SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<D> + From<FS>,
source§impl<'en, FD, FS, D, T, A> IntoView<'en, D> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
impl<'en, FD, FS, D, T, A> IntoView<'en, D> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
§type Txn = T
type Txn = T
The type of
Transaction
which this state supportssource§impl<FD, FS, D, T> Persist<D> for SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
impl<FD, FS, D, T> Persist<D> for SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
type Txn = T
type Schema = Schema
source§fn create(txn_id: TxnId, schema: Self::Schema, store: D::Store) -> TCResult<Self>
fn create(txn_id: TxnId, schema: Self::Schema, store: D::Store) -> TCResult<Self>
Create a new instance of
Self
from an empty Store
.source§fn load(txn_id: TxnId, schema: Self::Schema, store: D::Store) -> TCResult<Self>
fn load(txn_id: TxnId, schema: Self::Schema, store: D::Store) -> TCResult<Self>
Load a saved instance of
Self
from persistent storage.
Should only be invoked at startup time.source§impl<FD, FS, D, T> Restore<D> for SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
impl<FD, FS, D, T> Restore<D> for SparseTensor<FD, FS, D, T, SparseTable<FD, FS, D, T>>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<FS>,
source§impl<FD, FS, D, T, A> TensorAccess for SparseTensor<FD, FS, D, T, A>where
A: TensorAccess,
impl<FD, FS, D, T, A> TensorAccess for SparseTensor<FD, FS, D, T, A>where
A: TensorAccess,
source§impl<FD, FS, D, T, L, R> TensorBoolean<SparseTensor<FD, FS, D, T, R>> for SparseTensor<FD, FS, D, T, L>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = 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<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = 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.
source§fn 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
source§impl<FD, FS, D, T, A> TensorBoolean<Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T, A> TensorBoolean<Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
§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.
source§impl<FD, FS, D, T, A> TensorBooleanConst for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = 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<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = 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.
source§fn or_const(self, other: Number) -> TCResult<Self::DenseCombine>
fn or_const(self, other: Number) -> TCResult<Self::DenseCombine>
Logical or
source§fn xor_const(self, other: Number) -> TCResult<Self::DenseCombine>
fn xor_const(self, other: Number) -> TCResult<Self::DenseCombine>
Logical xor
source§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<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node>,
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<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node>,
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
source§fn 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
source§fn 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
source§fn 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
source§fn 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
source§impl<FD, FS, D, T, A> TensorCompare<Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T, A> TensorCompare<Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
source§impl<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
source§impl<FD, FS, D, T, A> TensorDiagonal<D> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<D> + From<FS>,
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
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<D> + From<FS>,
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,
source§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
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
L: TensorAccess + SparseWrite,
D::Write: DirCreateFile<FD>,
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
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
L: TensorAccess + SparseWrite,
D::Write: DirCreateFile<FD>,
§type Txn = T
type Txn = T
The type of
Transaction
to expectsource§impl<FD, FS, D, T, A> TensorDualIO<D, Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T> + SparseWrite,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS> + DirCreateFile<FD>,
D::Store: From<D> + From<FS>,
impl<FD, FS, D, T, A> TensorDualIO<D, Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T> + SparseWrite,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS> + DirCreateFile<FD>,
D::Store: From<D> + From<FS>,
§type Txn = T
type Txn = T
The type of
Transaction
to expectsource§impl<FD, FS, D, T, A> TensorIO<D> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: TensorAccess + SparseWrite + ReadValueAt<D, Txn = T>,
impl<FD, FS, D, T, A> TensorIO<D> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: TensorAccess + SparseWrite + ReadValueAt<D, Txn = T>,
§type Txn = T
type Txn = T
The type of
Transaction
to expectsource§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,
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
.source§impl<FD, FS, D, T, A> TensorIndex<D> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T> + SparseWrite,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<D> + From<FS>,
impl<FD, FS, D, T, A> TensorIndex<D> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
D: Dir + TryFrom<D::Store, Error = TCError>,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T> + SparseWrite,
D::Read: DirReadFile<FS>,
D::Write: DirCreateFile<FS>,
D::Store: From<D> + From<FS>,
§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
.source§impl<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
source§fn into_dense(self) -> Self::Dense
fn into_dense(self) -> Self::Dense
Return a dense representation of this
Tensor
.source§fn into_sparse(self) -> Self::Sparse
fn into_sparse(self) -> Self::Sparse
Return a sparse representation of this
Tensor
.source§impl<FD, FS, D, T, L, R> TensorMath<SparseTensor<FD, FS, D, T, R>> for SparseTensor<FD, FS, D, T, L>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner>,
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<SparseTensor<FD, FS, D, T, R>> for SparseTensor<FD, FS, D, T, L>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner>,
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
source§fn 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.
source§fn 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
.source§fn 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
.source§fn 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.
source§fn 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
.source§impl<FD, FS, D, T, A> TensorMath<Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T, A> TensorMath<Tensor<FD, FS, D, T>> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
§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
source§fn add(self, other: Tensor<FD, FS, D, T>) -> TCResult<Self::Combine>
fn add(self, other: Tensor<FD, FS, D, T>) -> TCResult<Self::Combine>
Add two tensors together.
source§fn 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
.source§fn 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.
source§impl<FD, FS, D, T, A> TensorMathConst for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = 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<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = 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
source§fn add_const(self, other: Number) -> TCResult<Self::DenseCombine>
fn add_const(self, other: Number) -> TCResult<Self::DenseCombine>
Add a constant to this tensor
source§fn sub_const(self, other: Number) -> TCResult<Self::DenseCombine>
fn sub_const(self, other: Number) -> TCResult<Self::DenseCombine>
Subtract
other
from self
.source§impl<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>
fn is_persistent(&self) -> bool
source§impl<FD, FS, D, T, A> TensorReduce<D> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
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
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
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
source§fn 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
.source§fn max_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>
fn max_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>
Return the maximum element in this
Tensor
.source§fn 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
.source§fn min_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>
fn min_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>
Return the minimum element in this
Tensor
.source§fn 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
.source§fn product_all(&self, txn: T) -> TCBoxTryFuture<'_, Number>
fn product_all(&self, txn: T) -> TCBoxTryFuture<'_, Number>
Return the product of all elements in this
Tensor
.source§fn 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
.source§fn sum_all(&self, txn: T) -> TCBoxTryFuture<'_, Number>
fn sum_all(&self, txn: T) -> TCBoxTryFuture<'_, Number>
Return the sum of all elements in this
Tensor
.source§impl<FD, FS, D, T, A> TensorTransform for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T, A> TensorTransform for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
A: SparseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
§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
source§fn broadcast(self, shape: Shape) -> TCResult<Self::Broadcast>
fn broadcast(self, shape: Shape) -> TCResult<Self::Broadcast>
Broadcast this
Tensor
to the given shape
.source§fn cast_into(self, dtype: NumberType) -> TCResult<Self::Cast>
fn cast_into(self, dtype: NumberType) -> TCResult<Self::Cast>
Cast this
Tensor
to the given dtype
.source§fn 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
.source§impl<FD, FS, D, T, A> TensorTrig for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = 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<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = 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
source§impl<FD, FS, D, T, A> TensorUnary<D> for SparseTensor<FD, FS, D, T, A>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = 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<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = 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
source§fn 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.source§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,
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,
§type Commit = <SparseTable<FD, FS, D, T> as Transact>::Commit
type Commit = <SparseTable<FD, FS, D, T> as Transact>::Commit
A guard which blocks concurrent commits
source§fn commit<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = Self::Commit> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn commit<'life0, 'async_trait>(
&'life0 self,
txn_id: TxnId
) -> Pin<Box<dyn Future<Output = Self::Commit> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Commit this transaction.
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§
source§impl<F> Match for F
impl<F> Match for F
source§fn 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
.source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value
can be cast into Self
.source§fn 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
.source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self
can be cast into T
.source§fn 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
.