Realm

oa::ml::matrix::fold

Combine [N, C * kernel², L] sliding columns into an overlapping NCHW Matrix. This is the deterministic adjoint of unfold: overlapping taps are summed per output element without atomics. output_height and output_width name the reconstructed image extent and must reproduce exactly L = output_height_positions * output_width_positions sliding columns under the same kernel geometry. Errors Returns an error unless input is a nonempty [N, C * kernel², L] rank-three F32 Matrix whose channel count is divisible by kernel² and whose column count equals the sliding extent of the requested output image, kernel/stride/dilation are nonzero, extents fit the shader ABI, or recording fails.

FnRust public API

Function Documentation

pub fn fold( input: &Matrix, output_height: usize, output_width: usize, kernel_size: usize, stride: usize, padding: usize, dilation: usize ) -> Result<Matrix>
Combine [N, C * kernel², L] sliding columns into an overlapping NCHW Matrix. This is the deterministic adjoint of unfold: overlapping taps are summed per output element without atomics. output_height and output_width name the reconstructed image extent and must reproduce exactly L = output_height_positions * output_width_positions sliding columns under the same kernel geometry. Errors Returns an error unless input is a nonempty [N, C * kernel², L] rank-three F32 Matrix whose channel count is divisible by kernel² and whose column count equals the sliding extent of the requested output image, kernel/stride/dilation are nonzero, extents fit the shader ABI, or recording fails.