Hi, I am trying to multiply two tensors of size (N, d) and (N, d) in the sense that each row is multiplied element-wise and summed over. What is the best practice?
More specifically, suppose that the two tensors are (e.g., N = 2, d = 4)
A = torch.Tensor([[1, 2, 3, 4], [5, 6, 7, 8]])
B = torch.Tensor([[4, 3, 2, 1], [8, 7, 6, 5]])

and I want to get the following result,
torch.Tensor([[20], [164]])

Thanks!