Hi. I believe you’re looking for torch.bmm or the batch matrix multiplication. An example is,
In [1]: import torch

In [2]: t1 = torch.rand((32, 40, 7))

In [3]: t2 = torch.rand((32, 80, 7))

In [4]: bm = torch.bmm(t1, t2.transpose(2,1))

In [5]: bm.shape
Out[5]: torch.Size([32, 40, 80])

In [6]: 

Hope that helps