code: def check_module_output_dimension(
      module: Union[Iterable[torch.nn.Module], torch.nn.Module],
      in_features: int,
      out_features: int,
  ) -> bool:
      """
      Verify that the out_features of a given module or a list of modules matches the
      specified number. If a list of modules or a ModuleList is given, recursively check
      all the submodules.
      """
      if isinstance(module, list) or isinstance(
          module, torch.nn.ModuleList
      ):
          return all(
              check_module_output_dimension(
                  submodule, in_features, out_features
              )
              for submodule in module
          )
      else:
          # pyre-fixme[6]: Expected `Union[typing.Callable[[torch.Tensor],
          #  torch.Tensor], torch.nn.Module]` for 1st param but got
          #  `Union[Iterable[torch.nn.Module], torch.nn.Module]`.
          return (
              get_module_output_dimension(module, in_features)
              == out_features
          )
  
file_path: torchrec/torchrec/modules/utils.py
imports: import copy
  from typing import Callable, Iterable, Tuple, Union
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: check_module_output_dimension(module, in_features, out_features) and returns: all, unknown