title: Understanding PyTorch einsum
body: <p>I'm familiar with how <a href="https://en.wikipedia.org/wiki/Einstein_notation" rel="noreferrer"><strong><code>einsum</code></strong></a> works in NumPy. A similar functionality is also offered by PyTorch: <a href="https://pytorch.org/docs/stable/torch.html#torch.einsum" rel="noreferrer"><strong>torch.einsum()</strong></a>. What are the similarities and differences, either in terms of functionality or performance? The information available at PyTorch documentation is rather scanty and doesn't provide any insights regarding this.</p>