code: def filtered_optimizer(optimizer, filter_fn):
      
      warnings.warn(
          "For filtering gradients, please use skorch.callbacks.Freezer.",
          DeprecationWarning)
  
      return partial(_make_optimizer, optimizer=optimizer, filter_fn=filter_fn)
docs: Wraps an optimizer that filters out parameters where
      ``filter_fn`` over ``pgroups`` returns ``False``.
      This function can be used, for example, to filter parameters
      that do not require a gradient:
  
      >>> from skorch.helper import filtered_optimizer, filter_requires_grad
      >>> optimizer = filtered_optimizer(torch.optim.SGD, filter_requires_grad)
      >>> net = NeuralNetClassifier(module, optimizer=optimizer)
  
      Parameters
      ----------
      optimizer : torch optim (class)
        The uninitialized optimizer that is wrapped
  
      filter_fn : function
        Use this function to filter parameter groups before passing
        it to ``optimizer``.