code: def _buffer_param_check(
      self,
      module: nn.Module,
      module_copy: nn.Module,
      device: torch.device,
      device_copy: torch.device,
      recurse: bool = True,
  ) -> None:
      # check all buffer/param under the module is value-identical
      # but device-different with the copied module.
      for (name, buffer), (name_copy, buffer_copy) in zip(
          list(module.named_buffers(recurse=recurse))
          + list(module.named_parameters(recurse=recurse)),
          list(module_copy.named_buffers(recurse=recurse))
          + list(module_copy.named_parameters(recurse=recurse)),
      ):
          self.assertEquals(name, name_copy)
          actual, expected = (
              buffer.detach().cpu(),
              buffer_copy.detach().cpu(),
          )
          rtol, atol = _get_default_rtol_and_atol(actual, expected)
          torch.testing.assert_close(
              actual, expected, rtol=rtol, atol=atol
          )
          self.assertEquals(buffer.detach().device, device)
          self.assertEquals(buffer_copy.detach().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 2 for calling the QuantModelParallelModelCopyTest obj's underlying member method code with example usage: obj._buffer_param_check(module, module_copy, device, device_copy, recurse) without return types