Hi,
If you do this, then all the gradients will accumulate. It may or may not be what you want.
From your description, it seems like you want a sliding window? Or is just reseting every N iterations enough?