<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def zero_grad(self):
 """Sets gradient buffer on all contexts to 0. No action is taken if parameter is uninitialized or doesn't require gradient."""

        if self._grad is None:
            return
        for i in self._grad:
            ndarray.zeros_like(i, out=i)