code: def testAll(self):
      num_embedding = 9
      transformer = IDTransformer(
          num_embedding,
          transform_config={
              "type": "naive",
          },
      )
      global_ids = torch.tensor([1, 2, 3, 4], dtype=torch.long)
      cache_ids = torch.empty_like(global_ids)
      result = transformer.transform(
          TensorList([global_ids]), TensorList([cache_ids]), 0
      )
      self.assertTrue(result.success)
  
      id_pairs = transformer.save().tolist()
      self.assertEqual(len(id_pairs), 4)
      id_dict = {1: 0, 2: 1, 3: 2, 4: 3}
      for global_id, cache_id in id_pairs:
          self.assertTrue(global_id in id_dict)
          self.assertEqual(cache_id, id_dict[global_id])
  
      global_ids = torch.tensor([1, 3, 5, 7], dtype=torch.long)
      result = transformer.transform(
          TensorList([global_ids]), TensorList([cache_ids]), 1
      )
      self.assertTrue(result.success)
  
      id_pairs = transformer.save().tolist()
      self.assertEqual(len(id_pairs), 4)
      id_dict = {1: 0, 3: 2, 5: 4, 7: 5}
      for global_id, cache_id in id_pairs:
          self.assertTrue(global_id in id_dict)
          self.assertEqual(cache_id, id_dict[global_id])
  
file_path: torchrec/contrib/dynamic_embedding/tests/test_id_transformer.py
imports: import unittest
  import torch
  from torchrec_dynamic_embedding.id_transformer import IDTransformer
  from torchrec_dynamic_embedding.tensor_list import TensorList
label_desc: Use image node_id 4 for calling the TestIDTransformer obj's underlying member method code with example usage: obj.testAll() without return types