nnsvs.util.pad_2d

nnsvs.util.pad_2d(x, max_len, constant_values=0)[source]

Pad a 2d-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