I have a question about how autograd handles Nans,
a = torch.tensor([np.nan, 2]) param = torch.tensor([1.], requires_grad=True) (a * param).backward() print(param.grad) # yields tensor([nan])
I was expecting it to return
tensor() since param grad is independent of the
Is this normal behavior ? Is there a way to force autograd to ignore
nan if the grad is independent of that value ?
Thank you for your answer.