gaozhihan/PreDiff

Timing to call .zero_grad()

JackChan1123 opened this issue · 1 comments

I noticed that you call .zero_grad() outside the IF condition in your VAE training script (line 454 & 467). Shouldn't we call it after .step() in IF condition? Otherwise the accumulated gradient in computation graphs will be erased.

Thank you very much for identifying this bug. It has been fixed in #33 .