class_docstr: Embed a sequence of categorical features.
  
  Parameters
  ----------
  cardinalities
      cardinality for each categorical feature.
  
  embedding_dims
      number of dimensions to embed each categorical feature.
  
  dtype
      Data type of the embedded features.
class_docstr_tok: ["Embed","a","sequence","of","categorical","features",".","Parameters","--","--","--","--","--","cardinalities","cardinality","for","each","categorical","feature",".","embedding_dims","number","of","dimensions","to","embed","each","categorical","feature",".","dtype","Data","type","of","the","embedded","features","."]
code: def __init__(
      self,
      cardinalities: List[int],
      embedding_dims: List[int],
      dtype: Type = np.float32,
      **kwargs,
  ) -> None:
      super().__init__(**kwargs)
  
      assert (
          len(cardinalities) > 0
      ), "Length of `cardinalities` list must be greater than zero"
      assert len(cardinalities) == len(
          embedding_dims
      ), "Length of `cardinalities` and `embedding_dims` should match"
      assert all(
          [c > 0 for c in cardinalities]
      ), "Elements of `cardinalities` should be > 0"
      assert all(
          [d > 0 for d in embedding_dims]
      ), "Elements of `embedding_dims` should be > 0"
  
      self.__num_features = len(cardinalities)
      self.dtype = dtype
  
      def create_embedding(i: int, c: int, d: int) -> nn.Embedding:
          embedding = nn.Embedding(
              c, d, prefix=f"cat_{i}_embedding_", dtype=self.dtype
          )
          self.register_child(embedding)
          return embedding
  
      with self.name_scope():
          self.__embedders = [
              create_embedding(i, c, d)
              for i, (c, d) in enumerate(
                  zip(cardinalities, embedding_dims)
              )
          ]
  
file_path: gluonts/src/gluonts/mx/block/feature.py
imports: from typing import Callable, List, Optional, Type
  import mxnet.gluon.nn
  import numpy
  from gluonts.core.component import validated
  from gluonts.mx import Tensor
label_desc: Use image node_id 1 to create a new FeatureEmbedder object from inherited base classes: nn with example: obj = FeatureEmbedder(cardinalities, embedding_dims, dtype)