Demos
Guides
Advanced guides
Notes
Package reference
pad_2d()
Resources
Meta information
Pad a 2d-tensor.
x (torch.Tensor) – tensor to pad
max_len (int) – maximum length of the tensor
constant_values (int, optional) – value to pad with. Default: 0
padded tensor
torch.Tensor