Oh you’re right!
You should consider opening an issue on Github about the error message. If you look at the docs of torch.stack 38, you’ll see:

All tensors need to be of the same size.

But when you do:
import torch
a = torch.zeros([1, 20])
b = torch.zeros([2, 20])
torch.stack([a, b])

You get
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 1 and 2 in dimension 1 at …
My hunch is it’s doing an unsqueeze and a cat in ATen, and the cat throws the error. I’m doing some digging to try to confirm.