code: def test_get_sharded_module_tree_with_module_name_to_fqns(self):
      model = CompositeModel(torch.device("cuda"))
      fully_shard(
          model,
          policy=ModuleWrapPolicy({UnitModule}),
      )
      (
          sharded_tree_info,
          sharded_module_name_to_fqns,
      ) = _get_sharded_module_tree_with_module_name_to_fqns(model)
      self.assertEqual(
          list(sharded_module_name_to_fqns.keys()),
          ["[CompositeModel]", "u1[UnitModule]", "u2[UnitModule]"],
      )
      self.assertEqual(
          list(sharded_module_name_to_fqns.values()),
          [
              ["l1.weight", "l1.bias", "l2.weight", "l2.bias"],
              [
                  "u1.l1.weight",
                  "u1.l1.bias",
                  "u1.seq.1.weight",
                  "u1.seq.1.bias",
                  "u1.l2.weight",
                  "u1.l2.bias",
              ],
              [
                  "u2.l1.weight",
                  "u2.l1.bias",
                  "u2.seq.1.weight",
                  "u2.seq.1.bias",
                  "u2.l2.weight",
                  "u2.l2.bias",
              ],
          ],
      )
      # Test nested fully_shard
      new_model = CompositeModel(torch.device("cuda"))
      fully_shard(new_model.u1)
      fully_shard(new_model)
      (
          sharded_tree_info,
          sharded_module_name_to_fqns,
      ) = _get_sharded_module_tree_with_module_name_to_fqns(new_model)
      self.assertEqual(
          list(sharded_module_name_to_fqns.keys()),
          ["[CompositeModel]", "u1[UnitModule]"],
      )
      self.assertEqual(
          list(sharded_module_name_to_fqns.values()),
          [
              [
                  "l1.weight",
                  "l1.bias",
                  "u2.l1.weight",
                  "u2.l1.bias",
                  "u2.seq.1.weight",
                  "u2.seq.1.bias",
                  "u2.l2.weight",
                  "u2.l2.bias",
                  "l2.weight",
                  "l2.bias",
              ],
              [
                  "u1.l1.weight",
                  "u1.l1.bias",
                  "u1.seq.1.weight",
                  "u1.seq.1.bias",
                  "u1.l2.weight",
                  "u1.l2.bias",
              ],
          ],
      )
  
file_path: pytorch/test/distributed/_composable/fully_shard/test_fully_shard_util.py
imports: import sys
  import torch
  import torch.distributed
  from torch.distributed._composable import fully_shard
  from torch.distributed.fsdp._debug_utils import _get_sharded_module_tree_with_module_name_to_fqns
  from torch.distributed.fsdp.wrap import ModuleWrapPolicy
  from torch.testing._internal.common_dist_composable import CompositeModel, UnitModule
  from torch.testing._internal.common_distributed import skip_if_lt_x_gpu
  from torch.testing._internal.common_fsdp import FSDPTest
  from torch.testing._internal.common_utils import run_tests, TEST_WITH_DEV_DBG_ASAN
label_desc: Use image node_id 3 for calling the TestUtils obj's underlying member method code with example usage: obj.test_get_sharded_module_tree_with_module_name_to_fqns() without return types