What is the recommend way to replace a particular value in a tensor with something else?
is torch.where() the most efficient solution?
q =[[0,1,2],[3,0,4],[5,6,0]]
tense_tensor = torch.tensor(q)
print(torch.where(tense_tensor==0,torch.tensor(-1),tense_tensor))