pub trait VirtualTensorOperations<E: Numeric> {
// Provided methods
fn read(&self, _index: u32) -> Line<E> { ... }
fn write(&self, _index: u32, _value: Line<E>) { ... }
fn shape(&self, _axis: u32) -> u32 { ... }
fn stride(&self, _axis: u32) -> u32 { ... }
fn rank(&self) -> u32 { ... }
}
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.