boundlab.linearop.pad_indices#

boundlab.linearop.pad_indices(input_shape, pad_spec)[source]#

Create slice indices for embedding input into a padded output.

The pad_spec follows PyTorch’s F.pad convention: [left, right, top, bottom, …] applied from the last dimension backwards.