code: def test_composability(
      self,
      data_type: DataType,
      quant_type: torch.dtype,
      output_type: torch.dtype,
  ) -> None:
      class TestModel(torch.nn.Module):
          def __init__(self, ebc: EmbeddingBagCollection) -> None:
              super().__init__()
              self.ebc = ebc
              self.over_arch = torch.nn.Linear(
                  16,
                  1,
              )
  
          def forward(self, kjt: KeyedJaggedTensor) -> torch.Tensor:
              ebc_output = self.ebc.forward(kjt).to_dict()
              sparse_features = []
              for key in kjt.keys():
                  sparse_features.append(ebc_output[key])
              sparse_features = torch.cat(sparse_features, dim=0)
              return self.over_arch(sparse_features)
  
      eb1_config = EmbeddingBagConfig(
          name="t1",
          embedding_dim=16,
          num_embeddings=10,
          feature_names=["f1"],
          data_type=data_type,
      )
      eb2_config = EmbeddingBagConfig(
          name="t2",
          embedding_dim=16,
          num_embeddings=10,
          feature_names=["f1"],
          data_type=data_type,
      )
      tables = [eb1_config, eb2_config]
  
      ebc = EmbeddingBagCollection(tables=tables)
      # test forward
      ebc.qconfig = torch.quantization.QConfig(
          activation=torch.quantization.PlaceholderObserver.with_args(
              dtype=output_type
          ),
          weight=torch.quantization.PlaceholderObserver.with_args(
              dtype=quant_type
          ),
      )
  
      test_model = TestModel(ebc)
  
      before_quant_state_dict = test_model.state_dict()
      test_model.ebc = QuantEmbeddingBagCollection.from_float(ebc)
  
      state_dict = test_model.state_dict()
      self.assertTrue(
          set(before_quant_state_dict.keys()).issubset(
              set(state_dict.keys())
          )
      )
      test_model.load_state_dict(state_dict)
  
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 9 for calling the EmbeddingBagCollectionTest obj's underlying member method code with example usage: obj.test_composability(data_type, quant_type, output_type) and returns: self