code: def from_float(
      cls, module: BaseEmbedding
  ) -> "QuantBatchedEmbeddingBag":
      assert hasattr(
          module, "qconfig"
      ), "BaseEmbedding input float module must have qconfig defined"
  
      data_type = dtype_to_data_type(module.qconfig.weight().dtype)
      sparse_type = data_type_to_sparse_type(data_type)
  
      # TODO Can we simplify this with state_dict = module.state_dict()?
      state_dict = (
          dict(module.named_split_embedding_weights())
          if isinstance(module, BatchedDenseEmbeddingBag)
          else dict(module.named_parameters())
      )
      device = next(iter(state_dict.values())).device
  
      config = _copy_config(
          module.config, data_type, sparse_type, device
      )
      ret = QuantBatchedEmbeddingBag(config=config, device=device)
  
      # pyre-ignore
      quant_weight_list = _quantize_weight(state_dict, data_type)
      ret.emb_module.assign_embedding_weights(quant_weight_list)
  
      return ret
  
imports: import copy
  import logging
  from typing import Any, Dict, Iterator, List, Optional, Tuple
  import torch
  import torch.distributed
  from fbgemm_gpu.split_embedding_configs import SparseType
  from fbgemm_gpu.split_table_batched_embeddings_ops_inference import EmbeddingLocation, IntNBitTableBatchedEmbeddingBagsCodegen, PoolingMode, rounded_row_size_in_bytes
  from torchrec.distributed.batched_embedding_kernel import BaseBatchedEmbedding, BaseBatchedEmbeddingBag, BatchedDenseEmbedding, BatchedDenseEmbeddingBag
  from torchrec.distributed.embedding_kernel import BaseEmbedding
  from torchrec.distributed.embedding_types import compute_kernel_to_embedding_location, GroupedEmbeddingConfig
  from torchrec.distributed.fused_params import is_fused_param_quant_state_dict_split_scale_bias, is_fused_param_register_tbe, tbe_fused_params, TBEToRegisterMixIn
  from torchrec.distributed.utils import append_prefix
  from torchrec.modules.embedding_configs import DATA_TYPE_NUM_BITS, data_type_to_sparse_type, DataType, dtype_to_data_type
  from torchrec.sparse.jagged_tensor import KeyedJaggedTensor
label_desc: Use image node_id 8 for calling the QuantBatchedEmbeddingBag obj's underlying member method code with example usage: obj.from_float(cls, module) and returns: ret