<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filter_requires_grad(pgroups):
 """Returns parameter groups where parameters that don't require a gradient are filtered out. Parameters pgroups : dict Parameter groups to be filtered """

    warnings.warn(
        "For filtering gradients, please use skorch.callbacks.Freezer.",
        DeprecationWarning)

    for pgroup in pgroups:
        output = {k: v for k, v in pgroup.items() if k != 'params'}
        output['params'] = (p for p in pgroup['params'] if p.requires_grad)
        yield output