code: def _recursive_device_check(
      self,
      module: nn.Module,
      module_copy: nn.Module,
      device: torch.device,
      device_copy: torch.device,
  ) -> None:
      if isinstance(module, ShardedModule):
          # sparse part parameter needs to be the same reference
          # TBE ops's parameter is accessed via buffer.
          for name_buffer, name_buffer_copy in zip(
              module.named_buffers(),
              module_copy.named_buffers(),
          ):
              name, buffer = name_buffer
              name_copy, buffer_copy = name_buffer_copy
              self.assertEqual(name, name_copy)
              # compare tensor storage reference
              self.assertTrue(
                  buffer.detach().is_set_to(buffer_copy.detach())
              )
          # don't go into named_children of ShardedModule
          return
      self._buffer_param_check(
          module, module_copy, device, device_copy, recurse=False
      )
      for name_child, name_child_copy in zip(
          module.named_children(), module_copy.named_children()
      ):
          name, child = name_child
          name_copy, child_copy = name_child_copy
          if not any(
              [
                  isinstance(submodule, ShardedModule)
                  for submodule in child.modules()
              ]
          ):
              # other part parameter/buffer needs to be
              # identical in value and different in device
              self._buffer_param_check(
                  child, child_copy, device, device_copy
              )
          else:
              self._recursive_device_check(
                  child, child_copy, device, device_copy
              )
  
imports: import unittest
  from typing import Any, cast, Dict, List, Optional, Tuple
  import hypothesis.strategies
  import torch
  from hypothesis import given, settings, Verbosity
  from torch import nn, quantization
  from torchrec.distributed.embedding_types import EmbeddingComputeKernel, ModuleSharder
  from torchrec.distributed.model_parallel import DistributedModelParallel
  from torchrec.distributed.planner import EmbeddingShardingPlanner, Topology
  from torchrec.distributed.planner.enumerators import EmbeddingEnumerator
  from torchrec.distributed.planner.shard_estimators import EmbeddingPerfEstimator, EmbeddingStorageEstimator
  from torchrec.distributed.quant_embeddingbag import QuantEmbeddingBagCollectionSharder
  from torchrec.distributed.shard import _shard_modules
  from torchrec.distributed.test_utils.test_model import _get_default_rtol_and_atol, ModelInput, TestSparseNN
  from torchrec.distributed.types import ShardedModule, ShardingEnv, ShardingType
  from torchrec.distributed.utils import copy_to_device
  from torchrec.modules.embedding_configs import EmbeddingBagConfig, QuantConfig
  from torchrec.modules.embedding_modules import EmbeddingBagCollection
  from torchrec.quant.embedding_modules import EmbeddingBagCollection, quant_prep_enable_quant_state_dict_split_scale_bias_for_types
  from torchrec.types import CopyMixIn
label_desc: Use image node_id 3 for calling the QuantModelParallelModelCopyTest obj's underlying member method code with example usage: obj._recursive_device_check(module, module_copy, device, device_copy) without return types