Hi,
I know there is a zero_grad function for the network, e.g.,
scores=vgg16(image)
vgg16.zero_grad()
When I do backward pass for the network, the image also get some gradient, right? If I want to zero all the grad for the image, how can I do it?
image is a Variable; image.zero_grad() will has en error.
Thanks!