oa::data::collate

Stack samples into a leading batch dimension using device-side concatenation. Inputs must be nonempty matrices of rank at most three, with any admitted Matrix dtype (U8, F32, I32, or U32). Labels must be present on every sample or absent on every sample. Each component must have equal shapes, dtypes, and one engine owner. A one-sample batch reuses its Matrix storage through zero-copy views. No default Engine or host readback is used. Errors Returns an error for empty input, inconsistent samples, unsupported rank, allocation failure, or GPU recording failure.

FnRust public API

Function Documentation

pub fn collate( samples: &[Sample] ) -> Result<Batch>
Stack samples into a leading batch dimension using device-side concatenation. Inputs must be nonempty matrices of rank at most three, with any admitted Matrix dtype (U8, F32, I32, or U32). Labels must be present on every sample or absent on every sample. Each component must have equal shapes, dtypes, and one engine owner. A one-sample batch reuses its Matrix storage through zero-copy views. No default Engine or host readback is used. Errors Returns an error for empty input, inconsistent samples, unsupported rank, allocation failure, or GPU recording failure.