class_docstr: Thin wrapper around PyTorch's Embedding op.
  
  :param config: Embedding config.
  :param embedding: pre-existing embedding Module.
  :param dtype: Torch data type for parameters.
code: def forward(self, data: pt.Tensor) -> pt.Tensor:
      primary_data = data[:, :, 0]
      embedded = self.embedding(primary_data)
  
      if self.num_factors > 1:
          average_factors_embeds = []
          concat_factors_embeds = []
          sum_factors_embeds = []
          for i, (factor_embedding, factor_combination) in enumerate(
              zip(self.factor_embeds, self.factor_combinations), 1
          ):
              factor_data = data[:, :, i]
              factor_embedded = factor_embedding(factor_data)
              if factor_combination == C.FACTORS_COMBINE_CONCAT:
                  concat_factors_embeds.append(factor_embedded)
              elif factor_combination == C.FACTORS_COMBINE_SUM:
                  sum_factors_embeds.append(factor_embedded)
              elif factor_combination == C.FACTORS_COMBINE_AVERAGE:
                  average_factors_embeds.append(factor_embedded)
              else:
                  raise ValueError(
                      f"Unknown combine value for factors: {factor_combination}"
                  )
  
          if average_factors_embeds:
              embedded = pt.mean(
                  pt.stack([embedded] + average_factors_embeds, dim=0),
                  dim=0,
              )
          if sum_factors_embeds:
              for sum_factor_embed in sum_factors_embeds:
                  embedded = embedded + sum_factor_embed
          if concat_factors_embeds:
              embedded = pt.cat(
                  [embedded] + concat_factors_embeds, dim=2
              )
  
      if self.dropout is not None:
          embedded = self.dropout(embedded)
  
      return embedded
  
imports: from abc import abstractmethod
  from dataclasses import dataclass, field
  from typing import List, Tuple, Optional, Union
  import torch
  import sockeye.constants
  from .None import config
  from .None import layers
  from .None import transformer
label_desc: Use image node_id 2 for calling the Embedding obj's underlying member method code with example usage: obj.forward(data) and returns: embedded