Solved by JuanFMontesinos in post #4 
              
              
                Oh btw I remembered that there is a function which return those indices: 
import torch

with torch.no_grad():
    tensor = torch.rand(4, 4)
    # generate zero elements
    tensor[tensor < 0.5] = 0
    print(tensor)
    # Obtain position of non-zero elements
    print(tensor.nonzero())

tensor([[0.0…