Trait tc_tensor::TensorReduce
source · pub trait TensorReduce<D: Dir> {
type Txn: Transaction<D>;
type Reduce: TensorInstance;
fn max(self, axis: usize, keepdims: bool) -> TCResult<Self::Reduce>;
fn max_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>;
fn min(self, axis: usize, keepdims: bool) -> TCResult<Self::Reduce>;
fn min_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>;
fn product(self, axis: usize, keepdims: bool) -> TCResult<Self::Reduce>;
fn product_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>;
fn sum(self, axis: usize, keepdims: bool) -> TCResult<Self::Reduce>;
fn sum_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>;
}
Expand description
Tensor
reduction operations
Required Associated Types§
sourcetype Txn: Transaction<D>
type Txn: Transaction<D>
The type of Transaction
to expect
sourcetype Reduce: TensorInstance
type Reduce: TensorInstance
The result type of a reduce operation
Required Methods§
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: Self::Txn) -> TCBoxTryFuture<'_, Number>
fn product_all(&self, txn: Self::Txn) -> 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: Self::Txn) -> TCBoxTryFuture<'_, Number>
fn sum_all(&self, txn: Self::Txn) -> TCBoxTryFuture<'_, Number>
Return the sum of all elements in this Tensor
.