Layers

Padding

class deephyper.layers.padding.Padding(*args, **kwargs)[source]

Multi-dimensions padding layer.

This operation pads a tensor according to the paddings you specify. paddings is an integer tensor with shape [n-1, 2], where n is the rank of tensor. For each dimension D of input, paddings[D, 0] indicates how many values to add before the contents of tensor in that dimension, and paddings[D, 1] indicates how many values to add after the contents of tensor in that dimension. The first dimension corresponding to the batch size cannot be padded.

Parameters
  • padding (list(list(int))) – e.g. [[1, 1]]

  • mode (str) – ‘CONSTANT’, ‘REFLECT’ or ‘SYMMETRIC’