This is a very confusing error message:
Exception has occurred: IndexError
Dimension out of range (expected to be in range of [-1, 0], but got 1)

What does it mean for a dimension to be in the range of [-1,0]?

Anyway, I just have 2 tensors and I want to put them right next to each other in a new tensor:
x_proc1
tensor(-0.9214, grad_fn=<AddBackward0>)
x_proc2
tensor(-1., grad_fn=<AddBackward0>)
x = [x_proc1,x_proc2]
x_proc = torch.stack(x, 1)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)