code: def test_mch_ebc_ec(self) -> None:
      device = torch.device("cpu")
      zch_size = 10
      mch_size = 10
      update_interval = 2
      update_size = 10
  
      embedding_bag_configs = [
          EmbeddingBagConfig(
              name="t1",
              embedding_dim=8,
              num_embeddings=zch_size + mch_size,
              feature_names=["f1", "f2"],
          ),
      ]
      embedding_configs = [
          EmbeddingConfig(
              name="t1",
              embedding_dim=8,
              num_embeddings=zch_size + mch_size,
              feature_names=["f1", "f2"],
          ),
      ]
  
      ebc = EmbeddingBagCollection(
          tables=embedding_bag_configs,
          device=device,
      )
      ec = EmbeddingCollection(
          tables=embedding_configs,
          device=device,
      )
  
      def preprocess_func(
          id: torch.Tensor, hash_size: int
      ) -> torch.Tensor:
          return id % hash_size
  
      mc_modules = {
          "t1": cast(
              ManagedCollisionModule,
              MCHManagedCollisionModule(
                  zch_size=zch_size,
                  mch_size=mch_size,
                  device=device,
                  eviction_interval=update_interval,
                  eviction_policy=DistanceLFU_EvictionPolicy(),
                  mch_hash_func=preprocess_func,
              ),
          ),
      }
      mcc_ec = ManagedCollisionCollection(
          managed_collision_modules=mc_modules,
          # pyre-ignore[6]
          embedding_configs=embedding_configs,
      )
      mcc_ebc = ManagedCollisionCollection(
          managed_collision_modules=deepcopy(mc_modules),
          # pyre-ignore[6]
          embedding_configs=embedding_bag_configs,
      )
      mc_ebc = ManagedCollisionEmbeddingBagCollection(
          ebc,
          mcc_ebc,
          return_remapped_features=True,
      )
      mc_ec = ManagedCollisionEmbeddingCollection(
          ec,
          mcc_ec,
          return_remapped_features=True,
      )
      mc_modules = [mc_ebc, mc_ec]
  
      for mc_module in mc_modules:
          update_one = KeyedJaggedTensor.from_lengths_sync(
              keys=["f1", "f2"],
              values=torch.concat(
                  [
                      torch.arange(
                          1000, 1000 + update_size, dtype=torch.int64
                      ),
                      torch.arange(
                          1000 + update_size,
                          1000 + 2 * update_size,
                          dtype=torch.int64,
                      ),
                  ]
              ),
              lengths=torch.ones((2 * update_size,), dtype=torch.int64),
              weights=None,
          )
          _, remapped_kjt1 = mc_module.forward(update_one)
          _, remapped_kjt2 = mc_module.forward(update_one)
  
          assert torch.all(
              # pyre-ignore[16]
              remapped_kjt1["f1"].values()
              == torch.arange(
                  zch_size, zch_size + mch_size, dtype=torch.int64
              )
          ), "all remapped ids are in mch section"
          assert torch.all(
              remapped_kjt1["f2"].values()
              == torch.arange(
                  zch_size, zch_size + mch_size, dtype=torch.int64
              )
          ), "all remapped ids are in mch section"
  
          assert torch.all(
              remapped_kjt2["f1"].values()
              == torch.cat(
                  [
                      torch.arange(0, 9, dtype=torch.int64),
                      torch.tensor(
                          [19], dtype=torch.int64
                      ),  # % MCH for last value
                  ]
              )
          )
  
          assert torch.all(
              remapped_kjt2["f2"].values()
              == torch.arange(
                  zch_size, zch_size + mch_size, dtype=torch.int64
              )
          ), "all remapped ids are in mch section"
  
          update_two = KeyedJaggedTensor.from_lengths_sync(
              keys=["f1", "f2"],
              values=torch.concat(
                  [
                      torch.arange(
                          2000, 2000 + update_size, dtype=torch.int64
                      ),
                      torch.arange(
                          1000 + update_size,
                          1000 + 2 * update_size,
                          dtype=torch.int64,
                      ),
                  ]
              ),
              lengths=torch.ones((2 * update_size,), dtype=torch.int64),
              weights=None,
          )
  
          _, remapped_kjt3 = mc_module.forward(update_two)
          _, remapped_kjt4 = mc_module.forward(update_two)
  
          assert torch.all(
              remapped_kjt3["f1"].values()
              == torch.arange(
                  zch_size, zch_size + mch_size, dtype=torch.int64
              )
          ), "all remapped ids are in mch section"
  
          assert torch.all(
              remapped_kjt3["f2"].values()
              == torch.arange(
                  zch_size, zch_size + mch_size, dtype=torch.int64
              )
          ), "all remapped ids are in mch section"
  
          assert torch.all(
              remapped_kjt4["f1"].values()
              == torch.arange(
                  zch_size, zch_size + mch_size, dtype=torch.int64
              )
          ), "all remapped ids are in mch section"
  
          assert torch.all(
              remapped_kjt4["f2"].values()
              == torch.cat(
                  [
                      torch.arange(0, 9, dtype=torch.int64),
                      torch.tensor(
                          [19], dtype=torch.int64
                      ),  # assigned first open slot
                  ]
              )
          )
  
file_path: torchrec/torchrec/modules/tests/test_mc_embedding_modules.py
imports: import unittest
  from copy import deepcopy
  from typing import cast, Dict, List, Optional
  import torch
  from torchrec.modules.embedding_configs import EmbeddingBagConfig, EmbeddingConfig
  from torchrec.modules.embedding_modules import EmbeddingBagCollection, EmbeddingCollection
  from torchrec.modules.mc_embedding_modules import ManagedCollisionEmbeddingBagCollection, ManagedCollisionEmbeddingCollection
  from torchrec.modules.mc_modules import DistanceLFU_EvictionPolicy, ManagedCollisionCollection, ManagedCollisionModule, MCHManagedCollisionModule
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor, KeyedTensor
label_desc: Use image node_id 4 for calling the MCHManagedCollisionEmbeddingBagCollectionTest obj's underlying member method code with example usage: obj.test_mch_ebc_ec() and returns: unknown