Skip to main content

reorder_data

Function reorder_data 

Source
pub fn reorder_data<T: Clone>(
    tensor: &DenseTensorData<T>,
    to: MemoryOrder,
) -> DenseTensorData<T>
Expand description

Reorder a DenseTensorData<T> to the requested memory layout.

If tensor.order() == to, returns a clone (zero-copy via Arc). Otherwise produces a new DenseTensorData whose layout order() matches to. Primary callers are the linalg kernels at their &DenseTensorData<T> entry points.