Skip to main content

split

Function split 

Source
pub fn split(input: &Matrix, sizes: &[i64], dim: i32) -> Result<Vec<Matrix>>
Expand description

Split input along dim into one device-resident matrix per sizes entry.

Every output owns an independent copy of its [offset, offset + size) slice along dim, matching OA C++ FnMatrix::split. The family records as one variadic semantic operation whose physical lowering is one slice dispatch per output; each output also carries a Slice adjoint, so reverse differentiation flows only through the segments used downstream.

ยงErrors

Returns an error when input is not FP32 or has rank outside 1..=4, dim is outside the rank, sizes is empty, contains a non-positive extent, or does not sum to the dim extent, an output size exceeds the shader ABI, allocation fails, or runtime recording fails.