code: def in_backward_optimizer_filter(
      named_parameters: Iterator[Tuple[str, nn.Parameter]],
      include: bool = False,
  ) -> Iterator[Tuple[str, nn.Parameter]]:
      """
      Filters named_parameters for whether they are or or not params that use
      the in_backward_optimizer.
      Note: This only supports the in_backward_optimizer from PT-D's API.
          The torchrec's equivalent API is deprecated and is not supported.
      Args:
      named_parameters(Iterator[Tuple[str, nn.Parameter]]): named_parameters
      include(bool): If true, only yields params with in_backward_optimizer. If false, returns the outside set
          Defaults to include params that are not in_backward (False)
      """
      for fqn, param in named_parameters:
          if hasattr(param, "_in_backward_optimizers") == include:
              yield fqn, param
  
imports: from typing import Iterable, Iterator, Tuple
  import torch
  from torch import nn
  from torch.optim.optimizer import Optimizer
label_desc: Use image node_id 1 for calling a global function with example usage: in_backward_optimizer_filter(named_parameters, include) without return types