I appreciate it if somebody helps me to check a tensor to be a valid indicator function.
Meaning that all elements of each row are zero beside one
So A is valid and B and C are not valid:
A = torch.tensor([[1, 0, 0], [0, 1, 0])
B = torch.tensor([[1, 0, 0], [0, 0, 0])
C = torch.tensor([[1, 0, 0], [1, 0, 1])