I want to check any one value in tensor is zero or not. For below program it shows “RuntimeError: Boolean value of Tensor with more than one value is ambiguous”
import torch
a=torch.tensor((torch.rand(4)))
a[1]=0
print(a)
if(a!=0):
print("All value is non zero")
else:
print("Atleast one value is zero")