Closed
Description
I want to accumulate the gradient value of multiple data before I do back-prop. In the old API, I can just run multiple times of back!(loss)
then call the udpate!(opt, params(model))
. However, with the new gradient
API, I have to collect all the Grad(...)
beforehand and then call multiple times of update!(opt, params(model)), grad)
. Are there any better ways to do this?