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
sourcetype 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
sourcefn div(self, other: O) -> TCResult<Self::LeftCombine>
fn div(self, other: O) -> TCResult<Self::LeftCombine>
Divide self by other.
sourcefn 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.
sourcefn mul(self, other: O) -> TCResult<Self::LeftCombine>
fn mul(self, other: O) -> TCResult<Self::LeftCombine>
Multiply two tensors together.
sourcefn pow(self, other: O) -> TCResult<Self::LeftCombine>
fn pow(self, other: O) -> TCResult<Self::LeftCombine>
Raise self to the power of other.