padding direction. Direction can be one of the following values: "both", "pre", and "post".
Slice or ndField
initial value for padding
list of lengths
import mir.ndslice.allocation: slice; import mir.ndslice.topology: iota; auto pad = iota([3], 1) .pad(0, [2]) .slice; assert(pad == [0, 0, 1, 2, 3, 0, 0]);
import mir.ndslice.allocation: slice; import mir.ndslice.topology: iota; auto pad = iota([2, 2], 1) .pad(0, [2, 1]) .slice; assert(pad == [ [0, 0, 0, 0], [0, 0, 0, 0], [0, 1, 2, 0], [0, 3, 4, 0], [0, 0, 0, 0], [0, 0, 0, 0]]);
._concatenation examples.
Pads with a constant value.