torch.nonzero is actually to find the index of the non-zero element in tensor. import torch label = torch.tensor([[1,0,0], [1,0,1]]) print(label.nonzero()).
確定! 回上一頁