ttslearn.util.pad_1d

ttslearn.util.pad_1d(x, max_len, constant_values=0)[source]

Pad a 1d-tensor.

Parameters
  • x (torch.Tensor) – tensor to pad

  • max_len (int) – maximum length of the tensor

  • constant_values (int, optional) – value to pad with. Default: 0

Returns

padded tensor

Return type

torch.Tensor