Solved by ptrblck in post #17 
              
              
                Thanks for the detailed code and explanations! 
Now I understand the problem and use case a bit better. 
Yes, you are right in that the tp, fp, tn, fn tensors are treated as logical indices. 
This advanced indexing behavior is different to the vanilla indexing and is explained a bit better in the nu…