dragon.vm.torch.nn.functional.pad(
input,
mode='constant',
value=0
)[source]

Pad the input according to the given sizes.

The padded dimension is computed as:

$\text{Dim}_{out} = \text{Dim}_{in} + pad_l + pad_r$

The pad should be a sequence of $$(N, 2)$$ values, where $$N$$ is the last n-dimensions to pad.

Parameters:
• input (dragon.vm.torch.Tensor) – The input tensor.