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.