docstr: Args:
      x (torch.Tensor): input tensor of shape batch x (optional) time x categoricals in the order of
          ``x_categoricals``.
  
  Returns:
      Union[Dict[str, torch.Tensor], torch.Tensor]: dictionary of category names to embeddings
          of shape batch x (optional) time x embedding_size if ``embedding_size`` is given as dictionary.
          Otherwise, returns the embedding of shape batch x (optional) time x sum(embedding_sizes).
          Query attribute ``output_size`` to get the size of the output(s).
docstr_tok: ["Args",":","x","(","torch.Tensor",")",":","input","tensor","of","shape","batch","x","(","optional",")","time","x","categoricals","in","the","order","of","``","x_categoricals","``",".","Returns",":","Union","[","Dict","[","str",",","torch.Tensor","]",",","torch.Tensor","]",":","dictionary","of","category","names","to","embeddings","of","shape","batch","x","(","optional",")","time","x","embedding_size","if","``","embedding_size","``","is","given","as","dictionary",".","Otherwise",",","returns","the","embedding","of","shape","batch","x","(","optional",")","time","x","sum","(","embedding_sizes",")",".","Query","attribute","``","output_size","``","to","get","the","size","of","the","output","(","s",")","."]
code: def forward(self, x: torch.Tensor) -> Dict[str, torch.Tensor]:
      """
      Args:
          x (torch.Tensor): input tensor of shape batch x (optional) time x categoricals in the order of
              ``x_categoricals``.
  
      Returns:
          Union[Dict[str, torch.Tensor], torch.Tensor]: dictionary of category names to embeddings
              of shape batch x (optional) time x embedding_size if ``embedding_size`` is given as dictionary.
              Otherwise, returns the embedding of shape batch x (optional) time x sum(embedding_sizes).
              Query attribute ``output_size`` to get the size of the output(s).
      """
      input_vectors = {}
      for name, emb in self.embeddings.items():
          if name in self.categorical_groups:
              input_vectors[name] = emb(
                  x[
                      ...,
                      [
                          self.x_categoricals.index(cat_name)
                          for cat_name in self.categorical_groups[name]
                      ],
                  ]
              )
          else:
              input_vectors[name] = emb(
                  x[..., self.x_categoricals.index(name)]
              )
  
      if self.concat_output:  # concatenate output
          return torch.cat(list(input_vectors.values()), dim=-1)
      else:
          return input_vectors
  
file_path: pytorch-forecasting/pytorch_forecasting/models/nn/embeddings.py
imports: from typing import Dict, List, Tuple, Union
  import torch
  import torch.nn
  from pytorch_forecasting.utils import get_embedding_size
label_desc: Use image node_id 10 for calling the MultiEmbedding obj's underlying member method code with example usage: obj.forward(x) and returns: torch, input_vectors