Just to add to what Anuvabh writes, setting requires_grad to False won’t set the grad to zero or None.  If a variable already has a grad from a previous backward pass, setting required_grad to False on it will just stop future backward passes from accumulating their gradients into it.