Hi,
I think the simplest is to write it as a matrix matrix multiplication. And so add a temporary dimension of size 1 on the first Tensor:
torch.matmul(torch.rand([16, 32, 56, 1, 64]),torch.rand([16, 32, 56, 64,25])).squeeze(-2)