Where to find the docs of axis parameter of torch.sum?
I'm trying to read about the sum function of torch here. I noticed that the following works:
&gt; print(torch.sum(torch.randint(0,2,(2,2)),axis=1))
tensor([1, 0])

But in the docs above I don't see explanation for axis.
In the signature of the function I see *:
torch.sum(input, *, dtype=None) → Tensor

Does it have to do something with this *? Where can I find the PyTorch docs that explains how to use axis? I came across with the same thing with other methods (with other arguments). So, although I know how to use axis, I would want to figure how to actually read the docs for the &quot;hidden&quot; arguments.

PyTorch emulates much of the basic functionality of Numpy (with additional GPU acceleration and autograd mechanics) but the API also differs in some small ways. For example, PyTorch generally uses the dim keyword argument to specify which dimension a function should operate on while Numpy uses the axis keyword argument to specify the same thing.
While undocumented it appears that the PyTorch devs have allowed users to use the axis keyword argument in place of dim for the sum function. This is probably to make the library more compatible with NumPy functions.
Therefore
torch.sum(x, dim=1)

is equivalent to
torch.sum(x, axis=1)

and both specify that you want to sum-reduce along dimension 1.
You can read about the NumPy version of sum here, which also provides additional examples of the axis argument.
