code: def test_per_tbe_clf_weighted_average(
      self,
      data_type: DataType,
      has_feature_processor: bool,
      embedding_dim: int,
      pooling_type: PoolingType,
  ) -> None:
      compute_kernels = [
          EmbeddingComputeKernel.FUSED_UVM_CACHING,
          EmbeddingComputeKernel.FUSED_UVM_CACHING,
          EmbeddingComputeKernel.FUSED,
          EmbeddingComputeKernel.FUSED_UVM,
      ]
      fused_params_groups = [
          {"cache_load_factor": 0.5},
          {"cache_load_factor": 0.3},
          {"cache_load_factor": 0.9},  # hbm table, would have no effect
          {"cache_load_factor": 0.4},  # uvm table, would have no effect
      ]
      tables = [
          ShardedEmbeddingTable(
              name=f"table_{i}",
              data_type=data_type,
              pooling=pooling_type,
              has_feature_processor=has_feature_processor,
              fused_params=fused_params_groups[i],
              compute_kernel=compute_kernels[i],
              embedding_dim=embedding_dim,
              num_embeddings=10000 * (2 * i + 1),  # 10000 and 30000
          )
          for i in range(4)
      ]
  
      # since we don't have access to _group_tables_per_rank
      tables_per_rank: List[List[ShardedEmbeddingTable]] = [tables]
  
      # taking only the list for the first rank
      table_groups: List[GroupedEmbeddingConfig] = group_tables(
          tables_per_rank
      )[0]
  
      # assert that they are grouped together
      self.assertEqual(len(table_groups), 1)
  
      table_group = table_groups[0]
      self.assertIsNotNone(table_group.fused_params)
      self.assertEqual(
          table_group.fused_params.get("cache_load_factor"), 0.35
      )
  
imports: import random
  import unittest
  from typing import Any, Dict, List
  from unittest.mock import MagicMock
  import hypothesis.strategies
  from hypothesis import given, settings
  from torchrec.distributed.embedding_lookup import EmbeddingComputeKernel
  from torchrec.distributed.embedding_sharding import _get_compute_kernel_type, _get_grouping_fused_params, _get_weighted_avg_cache_load_factor, group_tables
  from torchrec.distributed.embedding_types import GroupedEmbeddingConfig, ShardedEmbeddingTable
  from torchrec.modules.embedding_configs import DataType, PoolingType
label_desc: Use image node_id 1 for calling the TestPerTBECacheLoadFactor obj's underlying member method code with example usage: obj.test_per_tbe_clf_weighted_average(data_type, has_feature_processor, embedding_dim, pooling_type) without return types