nabu.processing.padding_base module

class nabu.processing.padding_base.PaddingBase(shape, pad_width, mode='constant', **kwargs)[source]

Bases: object

A class for performing padding based on coordinate transform. The Cuda and OpenCL backends will subclass this class.

Initialize a Padding object.

Parameters:
  • shape (tuple) – Image shape

  • pad_width (tuple) – Padding width for each axis. Please see the documentation of numpy.pad().

  • mode (str) – Padding mode

  • constant_values (tuple) – Tuple containing the values to fill when mode=”constant” (as in numpy.pad)

supported_modes = ['constant', 'edge', 'reflect', 'symmetric', 'wrap']