Skip to main content

storage_from_payload_native

Function storage_from_payload_native 

Source
pub fn storage_from_payload_native(
    payload: Tensor,
    output_payload_dims: &[usize],
    output_axis_classes: Vec<usize>,
) -> Result<Storage, BridgeError>
Expand description

Build structured storage from a native payload, preserving its dtype.

output_payload_dims and output_axis_classes describe the planned compact layout. The compact payload keeps the native tensor’s scalar dtype, so a narrow contraction result stays narrow.

§Errors

Returns a BridgeError when the payload shape does not match output_payload_dims, when its dtype has no compact storage representation, or when the storage metadata or payload read fails.