code: def _module_wrap_policy(
      module: nn.Module,
      recurse: bool,
      nonwrapped_numel: int,
      module_classes: Set[Type[nn.Module]],
  ) -> bool:
      """
      This auto wrap policy wraps every module that is an instance of any type in
      ``module_classes`` as its own FSDP instance. The root module given by
      ``module`` is always wrapped as an FSDP instance regardless. Since the
      wrapping proceeds bottom up, each FSDP instance manages the parameters in
      its subtree excluding any already managed by a child FSDP instance.
  
      Args:
          module (nn.Module): Current module being considered.
          recurse (bool): If ``False``, then this function must decide whether
              ``module`` should be wrapped as an FSDP instance or not. If
              ``True``, then the function is still recursing down the module
              tree as a part of the DFS.
          nonwrapped_numel (int): Parameter numel not yet wrapped.
          module_classes (Set[Type[nn.Module]]): Set of module classes that are
              wrapped as FSDP instances.
  
      Returns:
          ``True`` if ``recurse=True``, and whether ``module`` should be wrapped
          if ``recurse=False``.
      """
      if recurse:
          return True  # always recurse
      return isinstance(module, tuple(module_classes))
  
imports: import contextlib
  import copy
  from abc import ABC, abstractmethod
  from typing import Any, Callable, cast, Dict, Generator, Iterable, Optional, Sequence, Set, Tuple, Type, Union
  import torch.nn
label_desc: Use image node_id 5 for calling a global function with example usage: _module_wrap_policy(module, recurse, nonwrapped_numel, module_classes) and returns: isinstance, True