I am having a really odd issue with torch.stack where if I write something like:
a = torch.ones(3, 100, 100)
b = torch.zeros(2, 3, 100, 100)
torch.stack([a, a], dim=0, out=b)

it fails with
RuntimeError: cat(): functions with out=... arguments don't support automatic differentiation, but one of the arguments requires grad.
I can’t find any documentation related to this error. This error originally occurred while using the default_collate function in pytorch, however, I am able to recreate it using the lines above.