Shortcuts

Pad

class torchtime.transforms.Pad(series_length: int, fill: Union[float, int] = 0, padding_mode='constant')[source]

Pads a time series to a given target length

Parameters:
  • series_length (int) – the target length of the time series

  • fill (float, int) – fill value for ‘constant’ padding. Default 0.

  • padding_mode (str) – the padding mode that should be used. One of ‘constant’, ‘reflect’ or ‘replicate’. Default ‘constant’.

forward(series: Tensor) Tensor[source]
Parameters:

series (Tensor) – Time series to be padded.

Returns:

Padded time series.

Return type:

Tensor

extra_repr() str[source]

Set the extra representation of the module.

To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.

Return type:

str