Below you can find the code:
class mmm(torch.nn.Module):
def init(self):
super(mmm,self).init()
def forward(self, x, y):
xp=torch.reshape(x,(x.shape[0]*x.shape[1],x.shape[2]))
yp=torch.reshape(y,(y.shape[0]*y.shape[1],y.shape[2]))
out=torch.mm(xp,yp.permute(1,0))
return out