class_docstr: Enables different values in a categorical feature to share some embeddings across.
class_docstr_tok: ["Enables","different","values","in","a","categorical","feature","to","share","some","embeddings","across","."]
code: def forward(self, X: torch.Tensor) -> torch.Tensor:
      out = self.embed(X)
      shared_embed = self.shared_embed.expand(out.shape[0], -1)
      if self.add_shared_embed:
          out += shared_embed
      else:
          out[:, : shared_embed.shape[1]] = shared_embed
      return out
  
imports: import math
  from functools import partial
  from typing import Any, Dict, List, Optional, Tuple
  import torch
  from torch import nn
  from pytorch_tabular.models.common.layers.batch_norm import BatchNorm1d
  from pytorch_tabular.utils import _initialize_kaiming
label_desc: Use image node_id 2 for calling the SharedEmbeddings obj's underlying member method code with example usage: obj.forward(X) and returns: out