Skip to main content

storage_to_native_tensor

Function storage_to_native_tensor 

Source
pub fn storage_to_native_tensor(
    storage: &Storage,
    logical_dims: &[usize],
) -> Result<Tensor, BridgeError>
Expand description

Convert storage to a dense native tensor.

The native tensor keeps the storage’s own scalar dtype: a compact f32 or Complex32 payload becomes an f32/c32 native tensor instead of being widened to f64/Complex64.

§Errors

Returns a BridgeError when materializing storage to the requested dense shape fails (for example a shape mismatch) or when the dense-to-native conversion fails.