class_docstr: Module to embed Category, Date, and H3 data types.
class_docstr_tok: ["Module","to","embed","Category",",","Date",",","and","H3","data","types","."]
code: def forward(
      self, inputs: torch.Tensor, mask: Optional[torch.Tensor] = None
  ) -> torch.Tensor:
      if inputs.ndim != 2 or inputs.shape[1] != 1:
          raise RuntimeError(
              f"Embed only takes inputs of shape [batch x 1]. Received inputs with size: {inputs.size()}"
          )
      embedded = self.embeddings(inputs.long())
      embedded = torch.squeeze(embedded, dim=1)
      if self.dropout:
          embedded = self.dropout(embedded)
      return embedded
  
imports: import logging
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from torch import nn
  from ludwig.constants import TYPE
  from ludwig.modules.initializer_modules import get_initializer
  from ludwig.utils.data_utils import load_pretrained_embeddings
  from ludwig.utils.torch_utils import get_torch_device, LudwigModule
label_desc: Use image node_id 2 for calling the Embed obj's underlying member method code with example usage: obj.forward(inputs, mask) and returns: embedded