pkmr06/pytorch-smoothgrad

Atttribute error when trying to claculate x.grad in class VanillaGrad(object)

SmritiGovind opened this issue · 0 comments

in call(self, x, index)
45 # print('one_hot after backward:', one_hot)
46
---> 47 x.grad.data.zero_() # Reset the gradient to zero
48
49 # print('x=', x)

AttributeError: 'NoneType' object has no attribute 'data'