Trait tc_tensor::TensorMath
source · [−]pub trait TensorMath<D: Dir, O> {
type Combine: TensorInstance;
type LeftCombine: TensorInstance;
fn add(self, other: O) -> TCResult<Self::Combine>;
fn div(self, other: O) -> TCResult<Self::LeftCombine>;
fn log(self, base: O) -> TCResult<Self::LeftCombine>;
fn mul(self, other: O) -> TCResult<Self::LeftCombine>;
fn pow(self, other: O) -> TCResult<Self::LeftCombine>;
fn sub(self, other: O) -> TCResult<Self::Combine>;
}
Expand description
Tensor
math operations
Required Associated Types
type Combine: TensorInstance
type Combine: TensorInstance
The result type of a math operation
The result type of a math operation which may ignore right-hand-side values
Required Methods
fn div(self, other: O) -> TCResult<Self::LeftCombine>
fn div(self, other: O) -> TCResult<Self::LeftCombine>
Divide self
by other
.
fn log(self, base: O) -> TCResult<Self::LeftCombine>
fn log(self, base: O) -> TCResult<Self::LeftCombine>
Element-wise logarithm of self
with respect to the given base
.
fn mul(self, other: O) -> TCResult<Self::LeftCombine>
fn mul(self, other: O) -> TCResult<Self::LeftCombine>
Multiply two tensors together.
fn pow(self, other: O) -> TCResult<Self::LeftCombine>
fn pow(self, other: O) -> TCResult<Self::LeftCombine>
Raise self
to the power of other
.