Trait burn_tensor::Numeric

source ·
pub trait Numeric<B: Backend>: BasicOps<B>where
    Self::Elem: Element,{
Show 29 methods // Required methods fn add<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Self::Primitive<D>; fn add_scalar<const D: usize, E: ElementConversion>( lhs: Self::Primitive<D>, rhs: E ) -> Self::Primitive<D>; fn sub<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Self::Primitive<D>; fn sub_scalar<const D: usize, E: ElementConversion>( lhs: Self::Primitive<D>, rhs: E ) -> Self::Primitive<D>; fn div<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Self::Primitive<D>; fn div_scalar<const D: usize, E: ElementConversion>( lhs: Self::Primitive<D>, rhs: E ) -> Self::Primitive<D>; fn mul<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Self::Primitive<D>; fn mul_scalar<const D: usize, E: ElementConversion>( lhs: Self::Primitive<D>, rhs: E ) -> Self::Primitive<D>; fn neg<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<D>; fn zeros<const D: usize>( shape: Shape<D>, device: &B::Device ) -> Self::Primitive<D>; fn ones<const D: usize>( shape: Shape<D>, device: &B::Device ) -> Self::Primitive<D>; fn sum<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<1>; fn sum_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize ) -> Self::Primitive<D>; fn mean<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<1>; fn mean_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize ) -> Self::Primitive<D>; fn greater<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>; fn greater_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>; fn greater_equal<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>; fn greater_equal_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>; fn lower<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>; fn lower_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>; fn lower_equal<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>; fn lower_equal_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>; fn mask_scatter<const D: usize>( tensor: Self::Primitive<D>, mask: Tensor<B, D, Bool>, source: Self::Primitive<D> ) -> Self::Primitive<D>; fn mask_fill<const D: usize>( tensor: Self::Primitive<D>, mask: Tensor<B, D, Bool>, value: Self::Elem ) -> Self::Primitive<D>; fn index_select<const D: usize>( tensor: Self::Primitive<D>, indexes: Tensor<B, D, Int> ) -> Self::Primitive<D>; fn index_select_assign<const D: usize>( tensor: Self::Primitive<D>, indexes: Tensor<B, D, Int>, values: Self::Primitive<D> ) -> Self::Primitive<D>; fn index_select_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize, indexes: Tensor<B, 1, Int> ) -> Self::Primitive<D>; fn index_select_dim_assign<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, dim: usize, indexes: Tensor<B, 1, Int>, values: Self::Primitive<D2> ) -> Self::Primitive<D1>;
}
Expand description

Trait that list all operations that can be applied on all numerical tensors.

Warnings

This is an internal trait, use the public API provided by tensor struct.

Required Methods§

source

fn add<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Self::Primitive<D>

source

fn add_scalar<const D: usize, E: ElementConversion>( lhs: Self::Primitive<D>, rhs: E ) -> Self::Primitive<D>

source

fn sub<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Self::Primitive<D>

source

fn sub_scalar<const D: usize, E: ElementConversion>( lhs: Self::Primitive<D>, rhs: E ) -> Self::Primitive<D>

source

fn div<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Self::Primitive<D>

source

fn div_scalar<const D: usize, E: ElementConversion>( lhs: Self::Primitive<D>, rhs: E ) -> Self::Primitive<D>

source

fn mul<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Self::Primitive<D>

source

fn mul_scalar<const D: usize, E: ElementConversion>( lhs: Self::Primitive<D>, rhs: E ) -> Self::Primitive<D>

source

fn neg<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<D>

source

fn zeros<const D: usize>( shape: Shape<D>, device: &B::Device ) -> Self::Primitive<D>

source

fn ones<const D: usize>( shape: Shape<D>, device: &B::Device ) -> Self::Primitive<D>

source

fn sum<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<1>

source

fn sum_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize ) -> Self::Primitive<D>

source

fn mean<const D: usize>(tensor: Self::Primitive<D>) -> Self::Primitive<1>

source

fn mean_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize ) -> Self::Primitive<D>

source

fn greater<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>

source

fn greater_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>

source

fn greater_equal<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>

source

fn greater_equal_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>

source

fn lower<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>

source

fn lower_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>

source

fn lower_equal<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>

source

fn lower_equal_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>

source

fn mask_scatter<const D: usize>( tensor: Self::Primitive<D>, mask: Tensor<B, D, Bool>, source: Self::Primitive<D> ) -> Self::Primitive<D>

source

fn mask_fill<const D: usize>( tensor: Self::Primitive<D>, mask: Tensor<B, D, Bool>, value: Self::Elem ) -> Self::Primitive<D>

source

fn index_select<const D: usize>( tensor: Self::Primitive<D>, indexes: Tensor<B, D, Int> ) -> Self::Primitive<D>

source

fn index_select_assign<const D: usize>( tensor: Self::Primitive<D>, indexes: Tensor<B, D, Int>, values: Self::Primitive<D> ) -> Self::Primitive<D>

source

fn index_select_dim<const D: usize>( tensor: Self::Primitive<D>, dim: usize, indexes: Tensor<B, 1, Int> ) -> Self::Primitive<D>

source

fn index_select_dim_assign<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, dim: usize, indexes: Tensor<B, 1, Int>, values: Self::Primitive<D2> ) -> Self::Primitive<D1>

Implementors§

source§

impl<B: Backend> Numeric<B> for Float

source§

impl<B: Backend> Numeric<B> for Int