class_docstr: EmbeddingCollection represents a collection of non-pooled embeddings.
  
  It processes sparse data in the form of `KeyedJaggedTensor` of the form [F X B X L]
  where:
  
  * F: features (keys)
  * B: batch size
  * L: length of sparse features (variable)
  
  and outputs `Dict[feature (key), JaggedTensor]`.
  Each `JaggedTensor` contains values of the form (B * L) X D
  where:
  
  * B: batch size
  * L: length of sparse features (jagged)
  * D: each feature's (key's) embedding dimension and lengths are of the form L
  
  Args:
      tables (List[EmbeddingConfig]): list of embedding tables.
      device (Optional[torch.device]): default compute device.
      need_indices (bool): if we need to pass indices to the final lookup result dict
  
  Example::
  
      e1_config = EmbeddingConfig(
          name="t1", embedding_dim=3, num_embeddings=10, feature_names=["f1"]
      )
      e2_config = EmbeddingConfig(
          name="t2", embedding_dim=3, num_embeddings=10, feature_names=["f2"]
      )
  
      ec = EmbeddingCollection(tables=[e1_config, e2_config])
  
      #     0       1        2  <-- batch
      # 0   [0,1] None    [2]
      # 1   [3]    [4]    [5,6,7]
      # ^
      # feature
  
      features = KeyedJaggedTensor.from_offsets_sync(
          keys=["f1", "f2"],
          values=torch.tensor([0, 1, 2, 3, 4, 5, 6, 7]),
          offsets=torch.tensor([0, 2, 2, 3, 4, 5, 8]),
      )
      feature_embeddings = ec(features)
      print(feature_embeddings['f2'].values())
      tensor([[-0.2050,  0.5478,  0.6054],
      [ 0.7352,  0.3210, -3.0399],
      [ 0.1279, -0.1756, -0.4130],
      [ 0.7519, -0.4341, -0.0499],
      [ 0.9329, -1.0697, -0.8095]], grad_fn=<EmbeddingBackward>)
class_docstr_tok: ["EmbeddingCollection","represents","a","collection","of","non-pooled","embeddings",".","It","processes","sparse","data","in","the","form","of","`","KeyedJaggedTensor","`","of","the","form","[","F","X","B","X","L","]","where",":","*","F",":","features","(","keys",")","*","B",":","batch","size","*","L",":","length","of","sparse","features","(","variable",")","and","outputs","`","Dict","[","feature","(","key",")",",","JaggedTensor","]","`",".","Each","`","JaggedTensor","`","contains","values","of","the","form","(","B","*","L",")","X","D","where",":","*","B",":","batch","size","*","L",":","length","of","sparse","features","(","jagged",")","*","D",":","each","feature","'s","(","key","'s",")","embedding","dimension","and","lengths","are","of","the","form","L","Args",":","tables","(","List","[","EmbeddingConfig","]",")",":","list","of","embedding","tables",".","device","(","Optional","[","torch.device","]",")",":","default","compute","device",".","need_indices","(","bool",")",":","if","we","need","to","pass","indices","to","the","final","lookup","result","dict","Example",":",":","e1_config","=","EmbeddingConfig","(","name=","''","t1","''",",","embedding_dim=3",",","num_embeddings=10",",","feature_names=","[","``","f1","''","]",")","e2_config","=","EmbeddingConfig","(","name=","''","t2","''",",","embedding_dim=3",",","num_embeddings=10",",","feature_names=","[","``","f2","''","]",")","ec","=","EmbeddingCollection","(","tables=","[","e1_config",",","e2_config","]",")","#","0","1","2","<","--","batch","#","0","[","0,1","]","None","[","2","]","#","1","[","3","]","[","4","]","[","5,6,7","]","#","^","#","feature","features","=","KeyedJaggedTensor.from_offsets_sync","(","keys=","[","``","f1","''",",","``","f2","''","]",",","values=torch.tensor","(","[","0",",","1",",","2",",","3",",","4",",","5",",","6",",","7","]",")",",","offsets=torch.tensor","(","[","0",",","2",",","2",",","3",",","4",",","5",",","8","]",")",",",")","feature_embeddings","=","ec","(","features",")","print","(","feature_embeddings","[","'f2","'","]",".values","(",")",")","tensor","(","[","[","-0.2050",",","0.5478",",","0.6054","]",",","[","0.7352",",","0.3210",",","-3.0399","]",",","[","0.1279",",","-0.1756",",","-0.4130","]",",","[","0.7519",",","-0.4341",",","-0.0499","]",",","[","0.9329",",","-1.0697",",","-0.8095","]","]",",","grad_fn=","<","EmbeddingBackward",">",")"]
code: def from_float(
      cls, module: OriginalEmbeddingCollection
  ) -> "EmbeddingCollection":
      assert hasattr(
          module, "qconfig"
      ), "EmbeddingCollection input float module must have qconfig defined"
      embedding_configs = copy.deepcopy(module.embedding_configs())
      _update_embedding_configs(
          cast(List[BaseEmbeddingConfig], embedding_configs),
          module.qconfig,
      )
      table_name_to_quantized_weights: Dict[
          str, Tuple[Tensor, Tensor]
      ] = {}
      device = quantize_state_dict(
          module,
          table_name_to_quantized_weights,
          {table.name: table.data_type for table in embedding_configs},
      )
      return cls(
          embedding_configs,
          device=device,
          need_indices=module.need_indices(),
          output_dtype=module.qconfig.activation().dtype,
          table_name_to_quantized_weights=table_name_to_quantized_weights,
          register_tbes=getattr(
              module, MODULE_ATTR_REGISTER_TBES_BOOL, False
          ),
          quant_state_dict_split_scale_bias=getattr(
              module,
              MODULE_ATTR_QUANT_STATE_DICT_SPLIT_SCALE_BIAS,
              False,
          ),
          row_alignment=getattr(
              module,
              MODULE_ATTR_ROW_ALIGNMENT_INT,
              DEFAULT_ROW_ALIGNMENT,
          ),
      )
  
imports: import copy
  import itertools
  from collections import defaultdict
  from typing import Callable, cast, Dict, List, Optional, Tuple, Type, Union
  import torch
  import torch.nn
  from fbgemm_gpu.split_table_batched_embeddings_ops_inference import EmbeddingLocation, IntNBitTableBatchedEmbeddingBagsCodegen, PoolingMode
  from torch import Tensor
  from torchrec.distributed.utils import none_throws
  from torchrec.modules.embedding_configs import BaseEmbeddingConfig, DATA_TYPE_NUM_BITS, data_type_to_sparse_type, DataType, dtype_to_data_type, EmbeddingBagConfig, EmbeddingConfig, pooling_type_to_pooling_mode, PoolingType, QuantConfig
  from torchrec.modules.embedding_modules import EmbeddingBagCollection, EmbeddingBagCollectionInterface, EmbeddingCollection, EmbeddingCollectionInterface, get_embedding_names_by_table
  from torchrec.modules.feature_processor_ import FeatureProcessorsCollection
  from torchrec.modules.fp_embedding_modules import FeatureProcessedEmbeddingBagCollection
  from torchrec.sparse.jagged_tensor import JaggedTensor, KeyedJaggedTensor, KeyedTensor
  from torchrec.tensor_types import UInt2Tensor, UInt4Tensor
  from torchrec.types import ModuleNoCopyMixin
label_desc: Use image node_id 3 for calling the EmbeddingCollection obj's underlying member method code with example usage: obj.from_float(cls, module) and returns: cls