class_docstr: Enables different values in a categorical features to have different embeddings.
class_docstr_tok: ["Enables","different","values","in","a","categorical","features","to","have","different","embeddings","."]
code: def forward(self, x: Dict[str, Any]) -> torch.Tensor:
      assert (
          "continuous" in x or "categorical" in x
      ), "x must contain either continuous and categorical features"
      # (B, N)
      continuous_data, categorical_data = x.get(
          "continuous", torch.empty(0, 0)
      ), x.get("categorical", torch.empty(0, 0))
      assert categorical_data.shape[1] == len(
          self._onehot_feat_idx
          + self._binary_feat_idx
          + self._embedding_feat_idx
      ), "categorical_data must have same number of columns as categorical embedding layers"
      assert (
          continuous_data.shape[1] == self.continuous_dim
      ), "continuous_data must have same number of columns as continuous dim"
      # embed = None
      if continuous_data.shape[1] > 0:
          if self.batch_norm_continuous_input:
              continuous_data = self.normalizing_batch_norm(
                  continuous_data
              )
          # (B, N, C)
      if categorical_data.shape[1] > 0:
          x_cat = []
          x_cat_orig = []
          x_binary = []
          x_embed = []
          for i in range(self.categorical_dim):
              if i in self._binary_feat_idx:
                  x_binary.append(
                      categorical_data[:, i : i + 1]
                  )  # noqa: E203
              elif i in self._onehot_feat_idx:
                  x_cat.append(
                      self.one_hot_layers[str(i)](
                          categorical_data[:, i]
                      )
                  )
                  x_cat_orig.append(
                      categorical_data[:, i : i + 1]
                  )  # noqa: E203
              else:
                  x_embed.append(
                      self.embedding_layer[str(i)](
                          categorical_data[:, i]
                      )
                  )
          # (B, N, E)
          x_cat = torch.cat(x_cat, 1) if len(x_cat) > 0 else None
          x_cat_orig = (
              torch.cat(x_cat_orig, 1) if len(x_cat_orig) > 0 else None
          )
          x_binary = (
              torch.cat(x_binary, 1) if len(x_binary) > 0 else None
          )
          x_embed = torch.cat(x_embed, 1) if len(x_embed) > 0 else None
          all_none = (
              (x_cat is None)
              and (x_binary is None)
              and (x_embed is None)
          )
          assert not all_none, "All inputs can't be none!"
          if self.embd_dropout is not None:
              x_embed = self.embd_dropout(x_embed)
      else:
          x_cat = None
          x_cat_orig = None
          x_binary = None
          x_embed = None
      return OrderedDict(
          binary=x_binary,
          categorical=x_cat,
          _categorical_orig=x_cat_orig,
          continuous=continuous_data,
          embedding=x_embed,
      )
  
file_path: pytorch_tabular/src/pytorch_tabular/ssl_models/common/layers.py
imports: from collections import OrderedDict
  from typing import Any, Dict, Tuple
  import torch
  from torch import nn
  from pytorch_tabular.models.common.layers.batch_norm import BatchNorm1d
  from pytorch_tabular.ssl_models.common.utils import OneHot
label_desc: Use image node_id 3 for calling the MixedEmbedding1dLayer obj's underlying member method code with example usage: obj.forward(x) and returns: OrderedDict