class_docstr: Classical embeddings generator
class_docstr_tok: ["Classical","embeddings","generator"]
docstr: Apply embeddings to inputs
  Inputs should be (batch_size, input_dim)
  Outputs will be of size (batch_size, self.post_embed_dim)
docstr_tok: ["Apply","embeddings","to","inputs","Inputs","should","be","(","batch_size",",","input_dim",")","Outputs","will","be","of","size","(","batch_size",",","self.post_embed_dim",")"]
code: def forward(self, x):
      """
      Apply embeddings to inputs
      Inputs should be (batch_size, input_dim)
      Outputs will be of size (batch_size, self.post_embed_dim)
      """
      if self.skip_embedding:
          # no embeddings required
          return x
  
      cols = []
      cat_feat_counter = 0
      for feat_init_idx, is_continuous in enumerate(
          self.continuous_idx
      ):
          # Enumerate through continuous idx boolean mask to apply embeddings
          if is_continuous:
              cols.append(x[:, feat_init_idx].float().view(-1, 1))
          else:
              cols.append(
                  self.embeddings[cat_feat_counter](
                      x[:, feat_init_idx].long()
                  )
              )
              cat_feat_counter += 1
      # concat
      post_embeddings = torch.cat(cols, dim=1)
      return post_embeddings
  
imports: import torch
  from torch.nn import Linear, BatchNorm1d, ReLU
  import numpy
  from pytorch_tabnet import sparsemax
label_desc: Use image node_id 2 for calling the EmbeddingGenerator obj's underlying member method code with example usage: obj.forward(x) and returns: post_embeddings, x