Solved by tom in post #2 
              
              
                Good question, actually one of the exercises in my advanced autograd class. 
The answer lies in the autograd graph: 
x = torch.randn(5,5, requires_grad=True)
y = torch.randn(5,5, requires_grad=True)
a = torch.einsum('ik,kj->ij', x, y)
a

will show you that the grad_fn of a it is some view backward. …