optimizer.zero_grad()

Software / App

A method used to clear the gradients of all optimized tensors before the next backward pass.

Mentioned in 1 video