"@" for tensor multiplication using pytorch
This article https://towardsdatascience.com/understand-kaiming-initialization-and-implementation-detail-in-pytorch-f7aa967e9138 about intelligent weights initialization uses the syntax
x@w

to signify tensor (/matrix) multiplication.  I had not seen that before and instead had presumed we would need to &quot;spell it out&quot; as :
 torch.mm(x, w.t())

What is required to use the former (nicer) syntax? That article did not show a complete set of the imports they were using.

Just Python 3.5 and above can use this &quot;@&quot; syntax. The following are equivalent:
a = torch.rand(2,2)
b = torch.rand(2,2)

c = a.mm(b)
print(c)

c = torch.mm(a, b)
print(c)

c = torch.matmul(a, b)
print(c)

c = a @ b # python &gt; 3.5+
print(c)

Output:
tensor([[0.2675, 0.8140],
        [0.0415, 0.1644]])
tensor([[0.2675, 0.8140],
        [0.0415, 0.1644]])
tensor([[0.2675, 0.8140],
        [0.0415, 0.1644]])
tensor([[0.2675, 0.8140],
        [0.0415, 0.1644]])

I like to use mm syntax for matrix to matrix multiplication and mv for matrix to vector multiplication.
To get the transposed matrix I like to use easy a.T syntax.
One more thing to add:
a = torch.rand(2,2,2)
b = torch.rand(2,2,2)

c = torch.matmul(a, b)
print(c)

c = a @ b # python &gt; 3.5+
print(c)

Output:
tensor([[[0.2951, 0.3021],
         [0.8663, 1.0430]],

        [[0.2674, 1.3792],
         [0.0895, 0.9703]]])
tensor([[[0.2951, 0.3021],
         [0.8663, 1.0430]],

        [[0.2674, 1.3792],
         [0.0895, 0.9703]]])

mm cannot work for rank&gt;2 (tensor of rank 3 or more). So if you work with bigger ranks use just these: matmul or @ notation.
