Skip to main content

VirtualTensorOperations

Trait VirtualTensorOperations 

Source
pub trait VirtualTensorOperations<E: Numeric, N: Size>: Vectorized + CubeType<ExpandType: VirtualTensorOperationsExpand<E, N>> {
Show 18 methods // Provided methods fn as_tensor_map(&self) -> ComptimeOption<TensorMap<E, Tiled>> { ... } fn read(&self, _index: usize) -> Vector<E, N> { ... } fn read_window( &self, _start: usize, _end: usize, ) -> Slice<Vector<E, N>, ReadOnly> { ... } fn write(&self, _index: usize, _value: Vector<E, N>) { ... } fn shape(&self, _axis: usize) -> usize { ... } fn stride(&self, _axis: usize) -> usize { ... } fn rank(&self) -> usize { ... } fn len(&self) -> usize { ... } fn buffer_len(&self) -> usize { ... } fn __expand_as_tensor_map( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <ComptimeOption<TensorMap<E, Tiled>> as CubeType>::ExpandType { ... } fn __expand_read( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _index: <usize as CubeType>::ExpandType, ) -> <Vector<E, N> as CubeType>::ExpandType { ... } fn __expand_read_window( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _start: <usize as CubeType>::ExpandType, _end: <usize as CubeType>::ExpandType, ) -> <Slice<Vector<E, N>, ReadOnly> as CubeType>::ExpandType { ... } fn __expand_write( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _index: <usize as CubeType>::ExpandType, _value: <Vector<E, N> as CubeType>::ExpandType, ) -> <() as CubeType>::ExpandType { ... } fn __expand_shape( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _axis: <usize as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType { ... } fn __expand_stride( scope: &mut Scope, this: <Self as CubeType>::ExpandType, _axis: <usize as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType { ... } fn __expand_rank( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType { ... } fn __expand_len( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <usize as CubeType>::ExpandType { ... } fn __expand_buffer_len( scope: &mut Scope, this: <Self as CubeType>::ExpandType, ) -> <usize 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) -> ComptimeOption<TensorMap<E, Tiled>>

Source

fn read(&self, _index: usize) -> Vector<E, N>

Read the tensor at the given index.

Source

fn read_window( &self, _start: usize, _end: usize, ) -> Slice<Vector<E, N>, ReadOnly>

Source

fn write(&self, _index: usize, _value: Vector<E, N>)

Write the tensor at the given index.

Source

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

Get the shape of the tensor at the given axis.

Source

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

Get the stride of the tensor at the given axis.

Source

fn rank(&self) -> usize

Get the rank of the tensor.

Source

fn len(&self) -> usize

Source

fn buffer_len(&self) -> usize

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<E: Numeric, N: Size> VirtualTensorOperations<E, N> for Tensor<Vector<E, N>>

Source§

impl<E: Numeric, N: Size> VirtualTensorOperations<E, N> for TensorMap<E, Tiled>

Implementors§