code: def trainable_modules(
      module: nn.Module,
  ) -> Iterable[Tuple[str, nn.Module]]:
      """
      Recursively iterates over all submodules, returning those that
      have parameters and are trainable (ie they want a grad).
      """
      yield from (
          (m_name, m)
          for (m_name, m) in parametrized_modules(module)
          if any(p.requires_grad for p in m.parameters(recurse=False))
      )
  
file_path: opacus/opacus/utils/module_utils.py
imports: import io
  import logging
  import sys
  from typing import Dict, Iterable, List, Tuple
  import torch
  import torch.nn
label_desc: Use image node_id 3 for calling a global function with example usage: trainable_modules(module) without return types