Given a Tensor A of shape (N,C) and an indices Tensor Idx of shape (N,), i'd like to sum all the elements of each row in A excluding the corresponding column index in I. For example:
A = torch.tensor([[1,2,3], [4,5,6]]) Idx = torch.tensor([0,2]) #result: torch.tensor([[5], [9]]) A solution using loops is known.