PyTorch mapping operators to functions
What are all the PyTorch operators, and what are their function equivalents?

Eg, is a @ b equivalent to a.mm(b) or a.matmul(b)?

I'm after a canonical listing of operator -> function mappings.

I'd be happy to be given a PyTorch documentation link as an answer - my googlefu couldn't track it down.

The Python documentation table Mapping Operators to Functions provides canonical mappings from:

operator -> __function__()

Eg:


Matrix Multiplication        a @ b        matmul(a, b)



Elsewhere on the page, you will see the __matmul__ name as an alternate to matmul.

The definitions of the PyTorch __functions__ are found either in:


The torch.Tensor module documentation
python_variable_methods.cpp


You can look up the documentation for the named functions at:

https://pytorch.org/docs/stable/torch.html?#torch.&lt;FUNCTION-NAME&gt;

