dimensions to pad.
padding directions. Direction can be one of the following values: "both", "pre", and "post".
import mir.ndslice.allocation: slice; import mir.ndslice.topology: iota; auto pad = iota([2, 2], 1) .pad!([1], ["pre"])(0, [2]) .slice; assert(pad == [ [0, 0, 1, 2], [0, 0, 3, 4]]);
import mir.ndslice.allocation: slice; import mir.ndslice.topology: iota; auto pad = iota([2, 2], 1) .pad!([0, 1], ["both", "post"])(0, [2, 1]) .slice; assert(pad == [ [0, 0, 0], [0, 0, 0], [1, 2, 0], [3, 4, 0], [0, 0, 0], [0, 0, 0]]);
._concatenation examples.
Pads with a constant value.