Why do we need to set the gradients manually to zero in pytorch?

So We have to make sure that batchsize is not too large, or we will run out of memory.

1 Like