'Sets gradient buffer on all contexts to 0. No action is taken if
parameter is uninitialized or doesn\'t require gradient.'

def zero_grad(self):

    if (self._grad is None):
        return
    for i in self._grad.values():
        i[:] = 0
