class_docstr: Embed Dict of feature_id -> (feature values, offsets, weights) to list of tensors (1 tensor per feature ID) with EmbeddingBag,
  then apply optional pooling and MLP to final tensor.
  Passed in feature dict keys need to be in fixed order in forward.
code: def __init__(
      self,
      embedding_dim: int,
      weight_scale: float,
      features_embedding_bag_mode: Dict[int, str],
      embedding_bag_mode: Optional[str],
      ignore_weight: Optional[bool],
      pooling_type: str,
      mlp_layer_dims: List[int],
      feature_buckets: Dict[int, int],
  ) -> None:
      super().__init__(embedding_dim)
  
      features_embedding_bag_mode = {
          int(k): v for k, v in features_embedding_bag_mode.items()
      }
      if (
          ignore_weight is not None or embedding_bag_mode is not None
      ):  # for back-compatibility.
          assert (
              len(features_embedding_bag_mode) == 0
          ), "ignore_weight could only be set in old config and couldn't be set together with features_embedding_bag_mode"
          ignore_weight = ignore_weight or False
          embedding_bag_mode = embedding_bag_mode or "sum"
          features_embedding_bag_mode = {
              int(k): embedding_bag_mode if ignore_weight else "sum"
              for k in feature_buckets.keys()
          }
  
      self.weight_scale = weight_scale
      self.features_embedding_bag_mode = features_embedding_bag_mode
      self.pooling_type = pooling_type
      self.mlp_layer_dims = mlp_layer_dims
  
      self.feature_buckets = {
          int(k): v for k, v in feature_buckets.items()
      }
      self.feature_embeddings = nn.ModuleDict(
          {
              str(k): nn.EmbeddingBag(
                  v,
                  embedding_dim,
                  mode=self.features_embedding_bag_mode.get(k, "sum"),
              )
              for k, v in feature_buckets.items()
          }
      )
  
      self.num_intput_features = len(feature_buckets)
      input_dim = (
          self.num_intput_features * embedding_dim
          if self.pooling_type == "none"
          else embedding_dim
      )
      self.mlp = nn.Sequential(
          *(
              nn.Sequential(nn.Linear(m, n), nn.ReLU())
              for m, n in zip(
                  [input_dim] + list(mlp_layer_dims),
                  mlp_layer_dims,
              )
          )
      )
      log_class_usage(__class__)
  
file_path: pytext/pytext/models/embeddings/int_weighted_multi_category_embedding.py
imports: from typing import Dict, List, Optional, Tuple
  import torch
  import torch.nn
  from pytext.config.module_config import ModuleConfig
  from pytext.utils.usage import log_class_usage
  from .embedding_base import EmbeddingBase
label_desc: Use image node_id 2 to create a new IntWeightedMultiCategoryEmbedding object from inherited base classes: EmbeddingBase with example: obj = IntWeightedMultiCategoryEmbedding(embedding_dim, weight_scale, features_embedding_bag_mode, embedding_bag_mode, ignore_weight, pooling_type, mlp_layer_dims, feature_buckets)