VirtualTensorOperations

Trait VirtualTensorOperations 

Source
pub trait VirtualTensorOperations<E: Numeric>: Lined + CubeType<ExpandType: VirtualTensorOperationsExpand<E>> {
Show 18 methods // Provided methods fn as_tensor_map(&self) -> CubeOption<TensorMap<E>> { ... } fn read(&self, _index: u32) -> Line<E> { ... } fn read_window(&self, _start: u32, _end: u32) -> Slice<Line<E>, ReadOnly> { ... } fn write(&self, _index: u32, _value: Line<E>) { ... } fn shape(&self, _axis: u32) -> u32 { ... } fn stride(&self, _axis: u32) -> u32 { ... } fn rank(&self) -> u32 { ... } fn len(&self) -> u32 { ... } fn buffer_len(&self) -> u32 { ... } fn __expand_as_tensor_map( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <CubeOption<TensorMap<E>> as CubeType>::ExpandType { ... } fn __expand_read( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _index: <u32 as CubeType>::ExpandType, ) -> <Line<E> as CubeType>::ExpandType { ... } fn __expand_read_window( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _start: <u32 as CubeType>::ExpandType, _end: <u32 as CubeType>::ExpandType, ) -> <Slice<Line<E>, ReadOnly> as CubeType>::ExpandType { ... } fn __expand_write( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _index: <u32 as CubeType>::ExpandType, _value: <Line<E> as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType { ... } fn __expand_shape( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _axis: <u32 as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType { ... } fn __expand_stride( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _axis: <u32 as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType { ... } fn __expand_rank( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType { ... } fn __expand_len( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType { ... } fn __expand_buffer_len( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType { ... }
}
Expand description

Trait to be implemented by a type that can become a virtual tensor.

The expand trait also need to be implemented for the type’s expand type.

§Warning

This trait is kind of unsafe, VirtualTensorOperations::write doesn’t follow the mutability rules, but it won’t lead to any undefined behavior.

Provided Methods§

Source

fn as_tensor_map(&self) -> CubeOption<TensorMap<E>>

Source

fn read(&self, _index: u32) -> Line<E>

Read the tensor at the given index.

Source

fn read_window(&self, _start: u32, _end: u32) -> Slice<Line<E>, ReadOnly>

Source

fn write(&self, _index: u32, _value: Line<E>)

Write the tensor at the given index.

Source

fn shape(&self, _axis: u32) -> u32

Get the shape of the tensor at the given axis.

Source

fn stride(&self, _axis: u32) -> u32

Get the stride of the tensor at the given axis.

Source

fn rank(&self) -> u32

Get the rank of the tensor.

Source

fn len(&self) -> u32

Source

fn buffer_len(&self) -> u32

Source

fn __expand_as_tensor_map( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <CubeOption<TensorMap<E>> as CubeType>::ExpandType

Source

fn __expand_read( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _index: <u32 as CubeType>::ExpandType, ) -> <Line<E> as CubeType>::ExpandType

Source

fn __expand_read_window( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _start: <u32 as CubeType>::ExpandType, _end: <u32 as CubeType>::ExpandType, ) -> <Slice<Line<E>, ReadOnly> as CubeType>::ExpandType

Source

fn __expand_write( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _index: <u32 as CubeType>::ExpandType, _value: <Line<E> as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType

Source

fn __expand_shape( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _axis: <u32 as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType

Source

fn __expand_stride( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _axis: <u32 as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType

Source

fn __expand_rank( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType

Source

fn __expand_len( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType

Source

fn __expand_buffer_len( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <u32 as CubeType>::ExpandType

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<E: Numeric> VirtualTensorOperations<E> for Tensor<Line<E>>

Source§

impl<E: Numeric> VirtualTensorOperations<E> for TensorMap<E>

Implementors§