code: def convert_list_of_modules_to_modulelist(
      modules: Iterable[torch.nn.Module], sizes: Tuple[int, ...]
  ) -> torch.nn.Module:
      assert (
          # pyre-fixme[6]: Expected `Sized` for 1st param but got
          #  `Iterable[torch.nn.Module]`.
          len(modules)
          == sizes[0]
      ), f"the counts of modules ({len(modules)}) do not match with the required counts {sizes}"
      if len(sizes) == 1:
          return torch.nn.ModuleList(modules)
      else:
          # recursively create nested list
          return torch.nn.ModuleList(
              convert_list_of_modules_to_modulelist(m, sizes[1:])
              for m in modules
          )
  
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 6 for calling a global function with example usage: convert_list_of_modules_to_modulelist(modules, sizes) and returns: torch, torch