Realm

oa::matrix::pad

Pad a rank-one through rank-five FP32 matrix per dimension. pads holds one [before, after] pair per axis in input order; output[i] = input[i] + before_i + after_i per axis. fill applies only to PadMode::Constant. Reflect mode requires each pad amount to be smaller than the axis extent. Errors Returns an error when the rank, dtype, pad arity, reflect bound, shader ABI, allocation, or runtime recording contract is invalid.

FnRust public API

Function Documentation

pub fn pad( input: &Matrix, pads: &[usize], mode: PadMode, fill: f32 ) -> Result<Matrix>
Pad a rank-one through rank-five FP32 matrix per dimension. pads holds one [before, after] pair per axis in input order; output[i] = input[i] + before_i + after_i per axis. fill applies only to PadMode::Constant. Reflect mode requires each pad amount to be smaller than the axis extent. Errors Returns an error when the rank, dtype, pad arity, reflect bound, shader ABI, allocation, or runtime recording contract is invalid.