code: def _test_ebc(
      self,
      tables: List[EmbeddingBagConfig],
      features: KeyedJaggedTensor,
      quant_type: torch.dtype = torch.qint8,
      output_type: torch.dtype = torch.float,
      quant_state_dict_split_scale_bias: bool = False,
      per_table_weight_dtype: Optional[Dict[str, torch.dtype]] = None,
  ) -> None:
      ebc = EmbeddingBagCollection(tables=tables)
      if quant_state_dict_split_scale_bias:
          quant_prep_enable_quant_state_dict_split_scale_bias(ebc)
  
      embeddings = ebc(features)
  
      # test forward
      if not per_table_weight_dtype:
          ebc.qconfig = torch.quantization.QConfig(
              activation=torch.quantization.PlaceholderObserver.with_args(
                  dtype=output_type
              ),
              weight=torch.quantization.PlaceholderObserver.with_args(
                  dtype=quant_type
              ),
          )
      else:
          ebc.qconfig = QuantConfig(
              activation=torch.quantization.PlaceholderObserver.with_args(
                  dtype=output_type
              ),
              weight=torch.quantization.PlaceholderObserver.with_args(
                  dtype=quant_type
              ),
              per_table_weight_dtype=per_table_weight_dtype,
          )
  
      qebc = QuantEmbeddingBagCollection.from_float(ebc)
      quantized_embeddings = qebc(features)
  
      self.assertEqual(quantized_embeddings.values().dtype, output_type)
  
      self._asserting_same_embeddings(
          embeddings, quantized_embeddings, atol=1.0
      )
  
      # test state dict
      state_dict = ebc.state_dict()
      quantized_state_dict = qebc.state_dict()
      self.assertTrue(
          set(state_dict.keys()).issubset(
              set(quantized_state_dict.keys())
          )
      )
  
imports: import unittest
  from typing import Dict, List, Optional, Type
  import hypothesis.strategies
  import torch
  from hypothesis import given, settings, Verbosity
  from torchrec import inference
  from torchrec.modules.embedding_configs import DataType, EmbeddingBagConfig, EmbeddingConfig, QuantConfig
  from torchrec.modules.embedding_modules import EmbeddingBagCollection, EmbeddingCollection
  from torchrec.quant.embedding_modules import EmbeddingBagCollection, EmbeddingCollection, quant_prep_enable_quant_state_dict_split_scale_bias
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor, KeyedTensor
label_desc: Use image node_id 2 for calling the EmbeddingBagCollectionTest obj's underlying member method code with example usage: obj._test_ebc(tables, features, quant_type, output_type, quant_state_dict_split_scale_bias, per_table_weight_dtype) without return types