Looks like you can also do it with einsum 113:
einsum = torch.einsum('bi,bj->bij', (x, y))
Full example:
import torch
x = torch.ones(4, 3)
y = torch.rand(4, 3)
bmm = torch.bmm(x.unsqueeze(2), y.unsqueeze(1)) # Method of @fmassa
einsum = torch.einsum('bi,bj->bij', (x, y)) # Method with einsum
bmm==einsum # gives a whole bunch of ones