How would I pad this tensor by adding element 100 on the end
a = tensor([[ 101, 103],
[ 101, 1045, 223],
[ 101, 777, 665 , 889],
[ 101, 888]])
So the result would be:
b = tensor([[ 101, 103, 100, 100],
[ 101, 1045, 223, 100],
[ 101, 777, 665 , 889],
[ 101, 888, 100, 100]])
I know the functions is torch.nn.functional.pad(), but i could not any simple example with a tensor like this that is probably a 2d tensor.
Which was surprising, because this is what a (most) typical padding is.