pub trait TensorMathConst {
    type Combine: TensorInstance;

    // Required methods
    fn add_const(self, other: Number) -> TCResult<Self::Combine>;
    fn div_const(self, other: Number) -> TCResult<Self::Combine>;
    fn log_const(self, base: Number) -> TCResult<Self::Combine>;
    fn mul_const(self, other: Number) -> TCResult<Self::Combine>;
    fn pow_const(self, other: Number) -> TCResult<Self::Combine>;
    fn sub_const(self, other: Number) -> TCResult<Self::Combine>;
}
Expand description

Tensor constant math operations

Required Associated Types§

source

type Combine: TensorInstance

The return type of a math operation

Required Methods§

source

fn add_const(self, other: Number) -> TCResult<Self::Combine>

Add a constant to this tensor

source

fn div_const(self, other: Number) -> TCResult<Self::Combine>

Divide self by other.

source

fn log_const(self, base: Number) -> TCResult<Self::Combine>

Element-wise logarithm

source

fn mul_const(self, other: Number) -> TCResult<Self::Combine>

Multiply self by other.

source

fn pow_const(self, other: Number) -> TCResult<Self::Combine>

Raise self to the power other.

source

fn sub_const(self, other: Number) -> TCResult<Self::Combine>

Subtract other from self.

Implementors§

source§

impl<Txn, FE> TensorMathConst for DenseView<Txn, FE>
where Txn: Transaction<FE>, FE: DenseCacheFile + AsType<Node> + Clone,

§

type Combine = DenseView<Txn, FE>

source§

impl<Txn, FE> TensorMathConst for Tensor<Txn, FE>
where Txn: Transaction<FE>, FE: DenseCacheFile + AsType<Node> + Clone,

§

type Combine = Tensor<Txn, FE>

source§

impl<Txn, FE> TensorMathConst for SparseView<Txn, FE>
where Txn: Transaction<FE>, FE: DenseCacheFile + AsType<Node>,

§

type Combine = SparseView<Txn, FE>

source§

impl<Txn, FE, A> TensorMathConst for DenseTensor<Txn, FE, A>
where Txn: ThreadSafe, FE: ThreadSafe, A: DenseInstance, Number: CastInto<A::DType>,

§

type Combine = DenseTensor<Txn, FE, DenseConst<A, <A as DenseInstance>::DType>>

source§

impl<Txn, FE, A> TensorMathConst for SparseTensor<Txn, FE, A>
where Txn: ThreadSafe, FE: ThreadSafe, A: SparseInstance, A::DType: CastFrom<Number>, <A::DType as CType>::Float: CastFrom<Number>, Number: From<A::DType>,