torch.stack documentation shows the 2nd argument is dim
which is a keyword argument. However, I noticed torch.stack
also accepts axis
instead of dim
.
Here is an example:
a = torch.ones((10,20))
b = torch.stack(4*[a], dim=1)
c = torch.stack(4*[a], axis=1)
Why does torch.stack
accept axis
?
How would I be able to know that torch.stack accepts axis
?