pub enum Tensor<FD, FS, D, T> {
Dense(DenseTensor<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>),
Sparse(SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>),
}
Expand description
An n-dimensional array of numbers which supports basic math and logic operations
Variants§
Dense(DenseTensor<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>)
Sparse(SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>)
Implementations§
Trait Implementations§
source§impl<FD, FS, D, T> Debug for Tensor<FD, FS, D, T>where
DenseTensor<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>: Display,
SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>: Display,
impl<FD, FS, D, T> Debug for Tensor<FD, FS, D, T>where
DenseTensor<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>: Display,
SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>: Display,
source§impl<FD, FS, D, T> Display for Tensor<FD, FS, D, T>where
DenseTensor<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>: Display,
SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>: Display,
impl<FD, FS, D, T> Display for Tensor<FD, FS, D, T>where
DenseTensor<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>: Display,
SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>: Display,
source§impl<FD, FS, D, T, B> From<DenseTensor<FD, FS, D, T, B>> 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>,
B: DenseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T, B> From<DenseTensor<FD, FS, D, T, B>> 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>,
B: DenseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
source§fn from(dense: DenseTensor<FD, FS, D, T, B>) -> Self
fn from(dense: DenseTensor<FD, FS, D, T, B>) -> Self
Converts to this type from the input type.
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 Tensor<FD, FS, D, T>where
FD: File<Key = u64, Block = Array, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
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> + DirCreateFile<FD>,
D::Store: From<D> + From<FD> + From<FS>,
impl<FD, FS, D, T> FromStream for Tensor<FD, FS, D, T>where
FD: File<Key = u64, Block = Array, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
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> + DirCreateFile<FD>,
D::Store: From<D> + From<FD> + From<FS>,
source§impl<'en, FD, FS, D, T> IntoView<'en, D> 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>,
D::Write: DirCreateFile<FD>,
impl<'en, FD, FS, D, T> IntoView<'en, D> 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>,
D::Write: DirCreateFile<FD>,
§type Txn = T
type Txn = T
The type of
Transaction
which this state supports§type View = TensorView<'en>
type View = TensorView<'en>
The type of encodable view returned by
into_view
source§impl<FD, FS, D, T> TensorAccess for Tensor<FD, FS, D, T>where
DenseTensor<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>: TensorAccess,
SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>: TensorAccess,
impl<FD, FS, D, T> TensorAccess for Tensor<FD, FS, D, T>where
DenseTensor<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>: TensorAccess,
SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>: TensorAccess,
source§impl<FD, FS, D, T, B> TensorBoolean<Tensor<FD, FS, D, T>> for DenseTensor<FD, FS, D, T, B>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
B: DenseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T, B> TensorBoolean<Tensor<FD, FS, D, T>> for DenseTensor<FD, FS, D, T, B>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
B: DenseAccess<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> 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> TensorBoolean<Tensor<FD, FS, D, T>> 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>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> TensorBoolean<Tensor<FD, FS, D, T>> 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>,
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§fn and(self, other: Self) -> TCResult<Self::LeftCombine>
fn and(self, other: Self) -> TCResult<Self::LeftCombine>
Logical and
source§impl<FD, FS, D, T> TensorBooleanConst 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>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> TensorBooleanConst 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>,
D::Write: DirCreateFile<FD>,
§type DenseCombine = Tensor<FD, FS, D, T>
type DenseCombine = Tensor<FD, FS, D, T>
The return type of a boolean operation with a result expected to be dense.
source§impl<FD, FS, D, T, B> TensorCompare<Tensor<FD, FS, D, T>> for DenseTensor<FD, FS, D, T, B>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
B: DenseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T, B> TensorCompare<Tensor<FD, FS, D, T>> for DenseTensor<FD, FS, D, T, B>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
B: DenseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
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> TensorCompare<Tensor<FD, FS, D, T>> 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>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> TensorCompare<Tensor<FD, FS, D, T>> 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>,
D::Write: DirCreateFile<FD>,
source§impl<FD, FS, D, T> TensorCompareConst 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>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> TensorCompareConst 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>,
D::Write: DirCreateFile<FD>,
source§impl<FD, FS, D, T> TensorDiagonal<D> for Tensor<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> TensorDiagonal<D> for Tensor<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>,
source§impl<FD, FS, D, T, B> TensorDualIO<D, Tensor<FD, FS, D, T>> for DenseTensor<FD, FS, D, T, B>where
FD: File<Key = u64, Block = Array, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
B: DenseWrite<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
D::Store: From<FD>,
impl<FD, FS, D, T, B> TensorDualIO<D, Tensor<FD, FS, D, T>> for DenseTensor<FD, FS, D, T, B>where
FD: File<Key = u64, Block = Array, Inner = D::Inner> + TryFrom<D::Store, Error = TCError>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
B: DenseWrite<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
D::Store: From<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> TensorDualIO<D, Tensor<FD, FS, D, T>> for Tensor<FD, FS, D, T>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
DenseTensor<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>: TensorDualIO<D, Self, Txn = T>,
SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>: TensorDualIO<D, Self, Txn = T>,
impl<FD, FS, D, T> TensorDualIO<D, Tensor<FD, FS, D, T>> for Tensor<FD, FS, D, T>where
FD: File<Key = u64, Block = Array>,
FS: File<Key = NodeId, Block = Node>,
D: Dir,
T: Transaction<D>,
DenseTensor<FD, FS, D, T, DenseAccessor<FD, FS, D, T>>: TensorDualIO<D, Self, Txn = T>,
SparseTensor<FD, FS, D, T, SparseAccessor<FD, FS, D, T>>: TensorDualIO<D, Self, Txn = T>,
source§impl<FD, FS, D, T> TensorIO<D> 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>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> TensorIO<D> 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>,
D::Write: DirCreateFile<FD>,
§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> TensorIndex<D> for Tensor<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<FS> + DirCreateFile<FD>,
D::Store: From<D> + From<FS>,
impl<FD, FS, D, T> TensorIndex<D> for Tensor<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<FS> + DirCreateFile<FD>,
D::Store: From<D> + From<FS>,
source§impl<FD, FS, D, T> TensorInstance 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>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> TensorInstance 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>,
D::Write: DirCreateFile<FD>,
source§fn into_dense(self) -> Self
fn into_dense(self) -> Self
Return a dense representation of this
Tensor
.source§fn into_sparse(self) -> Self
fn into_sparse(self) -> Self
Return a sparse representation of this
Tensor
.source§impl<FD, FS, D, T, B> TensorMath<Tensor<FD, FS, D, T>> for DenseTensor<FD, FS, D, T, B>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner>,
D: Dir,
T: Transaction<D>,
B: DenseAccess<FD, FS, D, T>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T, B> TensorMath<Tensor<FD, FS, D, T>> for DenseTensor<FD, FS, D, T, B>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner>,
D: Dir,
T: Transaction<D>,
B: DenseAccess<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> 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> TensorMath<Tensor<FD, FS, D, T>> for Tensor<FD, FS, D, T>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner>,
D: Dir,
T: Transaction<D>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> TensorMath<Tensor<FD, FS, D, T>> for Tensor<FD, FS, D, T>where
FD: File<Key = u64, Block = Array, Inner = D::Inner>,
FS: File<Key = NodeId, Block = Node, Inner = D::Inner>,
D: Dir,
T: Transaction<D>,
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 div(self, other: Self) -> TCResult<Self::LeftCombine>
fn div(self, other: Self) -> TCResult<Self::LeftCombine>
Divide
self
by other
.source§fn log(self, base: Self) -> TCResult<Self::LeftCombine>
fn log(self, base: Self) -> TCResult<Self::LeftCombine>
Element-wise logarithm of
self
with respect to the given base
.source§fn mul(self, other: Self) -> TCResult<Self::LeftCombine>
fn mul(self, other: Self) -> TCResult<Self::LeftCombine>
Multiply two tensors together.
source§impl<FD, FS, D, T> TensorMathConst 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>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> TensorMathConst 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>,
D::Write: DirCreateFile<FD>,
§type DenseCombine = Tensor<FD, FS, D, T>
type DenseCombine = Tensor<FD, FS, D, T>
The return type of a math operation with a result expected to be dense
source§impl<FD, FS, D, T> TensorReduce<D> 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>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> TensorReduce<D> 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>,
D::Write: DirCreateFile<FD>,
§type Txn = T
type Txn = T
The type of
Transaction
to expectsource§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> TensorTransform 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>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> TensorTransform 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>,
D::Write: DirCreateFile<FD>,
source§impl<FD, FS, D, T> TensorTrig 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>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> TensorTrig 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>,
D::Write: DirCreateFile<FD>,
source§impl<FD, FS, D, T> TensorUnary<D> 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>,
D::Write: DirCreateFile<FD>,
impl<FD, FS, D, T> TensorUnary<D> 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>,
D::Write: DirCreateFile<FD>,
§type Txn = T
type Txn = T
The type of
Transaction
to expectsource§fn all<'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
fn all<'async_trait>(
self,
txn: T
) -> Pin<Box<dyn Future<Output = TCResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
Return
true
if all elements in this Tensor
are nonzero.Auto Trait Implementations§
impl<FD, FS, D, T> !RefUnwindSafe for Tensor<FD, FS, D, T>
impl<FD, FS, D, T> Send for Tensor<FD, FS, D, T>where
D: Send + Sync,
FD: Send,
FS: Send + Sync,
T: Send + Sync,
impl<FD, FS, D, T> Sync for Tensor<FD, FS, D, T>where
D: Send + Sync,
FD: Sync,
FS: Send + Sync,
T: Send + Sync,
impl<FD, FS, D, T> Unpin for Tensor<FD, FS, D, T>where
D: Unpin,
FD: Unpin,
FS: Unpin,
T: Unpin,
impl<FD, FS, D, T> !UnwindSafe for Tensor<FD, FS, D, T>
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
.