code: def get_named_optimizable_parameters(
      model: nn.Module, prefix: str = ""
  ) -> Iterator[Tuple[str, nn.Parameter]]:
      """
      Return list of parameters with requires_grad=True from the model.
      This function allows easily get all parameters that should be optimized.
      :param model: An instance of nn.Module.
      :return: Parameters with requires_grad=True.
      """
      return filter(
          lambda x: x[1].requires_grad, model.named_parameters(prefix)
      )
  
file_path: pytorch-toolbelt/pytorch_toolbelt/optimization/functional.py
imports: import dataclasses
  import numbers
  from typing import Optional, Iterator, Dict, Union, List, Tuple, Mapping
  from torch import nn
  from pytorch_toolbelt.utils.distributed import get_rank, get_world_size, is_dist_avail_and_initialized
  from pytorch_toolbelt.utils.torch_utils import get_non_wrapped_model
label_desc: Use image node_id 5 for calling a global function with example usage: get_named_optimizable_parameters(model, prefix) and returns: filter