Skip to main content

TensorLayoutMut

Trait TensorLayoutMut 

Source
pub unsafe trait TensorLayoutMut: TensorLayout {
    // Required method
    fn tensor_layout_mut(&mut self) -> RawLayout;
}
Expand description

A diffsol vector that a TensorViewMut can show, so that a C callback can write its values with no copy. The layout is [n, nbatch], the same as TensorLayout::tensor_layout.

§Safety

As for TensorLayout. TensorLayoutMut::tensor_layout_mut must give the same layout as TensorLayout::tensor_layout, with a pointer that allows writes to each value of the layout while the value is mutably borrowed.

Required Methods§

Source

fn tensor_layout_mut(&mut self) -> RawLayout

The layout of the data, with a pointer that allows writes.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: Scalar + FaerScalar> TensorLayoutMut for FaerVec<T>

Source§

impl<T: Scalar + NalgebraScalar> TensorLayoutMut for NalgebraVec<T>

Implementors§