You can use torch.matmul to get batch multiplication and possibly .view your 3,4 and 6,7 dimensions as one each before the multiplication and back into two in the result.
torch.matmul(A.view (10,3*4,5),B.view (10,5,6*7)).view (10,3,4,6,7)
Replace the hardcoded sizes appropriately.
Best regards
Thomas