pub unsafe trait TensorLayout {
// Required method
fn tensor_layout(&self) -> RawLayout;
}Expand description
A value that a Tensor can show with no copy of the data.
A diffsol vector or dense matrix shows its storage with the lane axis last. The storage of a
diffsol vector is an n × nbatch matrix with one column for each lane, which is already the
shape [n, nbatch]. A dense matrix has the shape [nrows, ncols, nbatch]. A Vec<T> has the
shape [len].
§Safety
TensorLayout::tensor_layout must give the layout of data that the value holds on the heap, so that the data does not move when the value moves. The data must not change while the value is borrowed (no interior mutability).
Required Methods§
Sourcefn tensor_layout(&self) -> RawLayout
fn tensor_layout(&self) -> RawLayout
The layout of the data.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".