prepare_output_owned

Function prepare_output_owned 

Source
pub fn prepare_output_owned<T: Scalar>(
    arr: &mut StridedArray<T>,
    _n_batch: usize,
    n_group1: usize,
    n_group2: usize,
    beta: T,
) -> Result<ContiguousOperandMut<T>>
Expand description

Prepare an owned mutable output array for GEMM.

Expects batch-last canonical order: [group1..., group2..., batch...]. If already contiguous after dimension grouping, uses the array in-place. Otherwise, allocates a col-major buffer and copies existing data when beta is non-zero.

Unlike prepare_output_view, needs_writeback is always false for owned arrays because the caller owns the buffer and can use it directly.

Currently unused in production (C is always a StridedViewMut from the caller). Kept for future use when einsum2_into accepts owned output arrays.