I’m trying to implement this tutorial http://pytorch.org/tutorials/beginner/blitz/neural_networks_tutorial.html
when I arrived to this point and print the output it gave me None, I couldn’t find a similar problem on the internet that explains why.
net.zero_grad() # zeroes the gradient buffers of all parameters
print('conv1.bias.grad before backward')
print(net.conv1.bias.grad)
but after applying backward the results are good
loss.backward()
print('conv1.bias.grad after backward')
print(net.conv1.bias.grad)