oa::ml::matrix::conv_2d

Apply grouped two-dimensional convolution to an NCHW Matrix. weight uses [output_channels, input_channels / groups, kernel, kernel] layout and bias uses [output_channels]. The output spatial extent is floor((input + 2 * padding - kernel) / stride) + 1. Errors Returns an error unless all inputs are same-engine F32 matrices, shapes and group divisibility agree, the square kernel fits the padded input, every extent fits the shader ABI, or runtime recording fails.

FnRust public API

Function Documentation

pub fn conv_2d( input: &Matrix, weight: &Matrix, bias: &Matrix, stride: usize, padding: usize, groups: usize ) -> Result<Matrix>
Apply grouped two-dimensional convolution to an NCHW Matrix. weight uses [output_channels, input_channels / groups, kernel, kernel] layout and bias uses [output_channels]. The output spatial extent is floor((input + 2 * padding - kernel) / stride) + 1. Errors Returns an error unless all inputs are same-engine F32 matrices, shapes and group divisibility agree, the square kernel fits the padded input, every extent fits the shader ABI, or runtime recording fails.