Equivalent, but a bit more concise:
a = torch.LongTensor([[1,2,3],[4,5,6]])
b = [torch.LongTensor([[1,1],[1,1]]),
       torch.LongTensor([[2,2],[4,4]]),
       torch.LongTensor([[3,3],[9,9]])]

b = torch.stack(b, dim=2)

c = b.mul(a.unsqueeze(1)).sum(dim=2).squeeze()