Trait burn_tensor::BasicOps

source ·
pub trait BasicOps<B: Backend>: TensorKind<B> {
    type Elem: 'static;

Show 14 methods // Required methods fn empty<const D: usize>( shape: Shape<D>, device: &B::Device ) -> Self::Primitive<D>; fn shape<const D: usize>(tensor: &Self::Primitive<D>) -> Shape<D>; fn reshape<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, shape: Shape<D2> ) -> Self::Primitive<D2>; fn index<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, indexes: [Range<usize>; D2] ) -> Self::Primitive<D1>; fn index_assign<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, indexes: [Range<usize>; D2], value: Self::Primitive<D1> ) -> Self::Primitive<D1>; fn device<const D: usize>(tensor: &Self::Primitive<D>) -> B::Device; fn to_device<const D: usize>( tensor: Self::Primitive<D>, device: &B::Device ) -> Self::Primitive<D>; fn into_data<const D: usize>( tensor: Self::Primitive<D> ) -> Data<Self::Elem, D>; fn from_data<const D: usize>( data: Data<Self::Elem, D>, device: &B::Device ) -> Self::Primitive<D>; fn repeat<const D: usize>( tensor: Self::Primitive<D>, dim: usize, times: usize ) -> Self::Primitive<D>; fn cat<const D: usize>( vectors: Vec<Self::Primitive<D>>, dim: usize ) -> Self::Primitive<D>; fn equal<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Primitive<D> ) -> Tensor<B, D, Bool>; fn equal_elem<const D: usize>( lhs: Self::Primitive<D>, rhs: Self::Elem ) -> Tensor<B, D, Bool>; // Provided method fn elem_type_name() -> &'static str { ... }
}
Expand description

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

Warnings

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

Required Associated Types§

source

type Elem: 'static

Required Methods§

source

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

source

fn shape<const D: usize>(tensor: &Self::Primitive<D>) -> Shape<D>

source

fn reshape<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, shape: Shape<D2> ) -> Self::Primitive<D2>

source

fn index<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, indexes: [Range<usize>; D2] ) -> Self::Primitive<D1>

source

fn index_assign<const D1: usize, const D2: usize>( tensor: Self::Primitive<D1>, indexes: [Range<usize>; D2], value: Self::Primitive<D1> ) -> Self::Primitive<D1>

source

fn device<const D: usize>(tensor: &Self::Primitive<D>) -> B::Device

source

fn to_device<const D: usize>( tensor: Self::Primitive<D>, device: &B::Device ) -> Self::Primitive<D>

source

fn into_data<const D: usize>(tensor: Self::Primitive<D>) -> Data<Self::Elem, D>

source

fn from_data<const D: usize>( data: Data<Self::Elem, D>, device: &B::Device ) -> Self::Primitive<D>

source

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

source

fn cat<const D: usize>( vectors: Vec<Self::Primitive<D>>, dim: usize ) -> Self::Primitive<D>

source

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

source

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

Provided Methods§

source

fn elem_type_name() -> &'static str

Implementors§

source§

impl<B: Backend> BasicOps<B> for Bool

§

type Elem = bool

source§

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

§

type Elem = <B as Backend>::FloatElem

source§

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

§

type Elem = <B as Backend>::IntElem