Insert a new size-1 dimension into tensor x at position dim.
x
dim
Input
x = tensor([[0, 1, 2], [3, 4, 5]]) dim = 1
Output
tensor([[[0, 1, 2]], [[3, 4, 5]]])
This one's part of Premium. Unlock the full PyTorch track plus every other premium problem on the site.
solve(...)