pytorch中的torch.nonzero(),就是返回张量中元素不为0的元素的索引。举例子如下:import torchx = torch.tensor([4,0,1,2,1,2,3])result = 1==x ...
確定! 回上一頁