About efficiency: is there e.g. any difference between
torch.bmm(a.unsqueeze(1), b.transpose(2, 1)).squeeze(1)
and
torch.bmm(b, a.unsqueeze(2)).squeeze(2)
in terms of operation speed, assuming that b.size()[0] >> b.size()[1] and b.size()[0] >> b.size()[2]
(i.e. the batch size being much bigger than any other dimension)?