I’m sorry but the way I cited is the way it works on math. The only change is that you are adding a 3rd dimension corresponding to the batch.
import torch

a = torch.rand(7,265,768)

b= torch.rand(7,768,500)

c=torch.bmm(a,b)

c.size()
Out[5]: torch.Size([7, 265, 500])