megengine.functional.nn.embedding

embedding(inp, weight, padding_idx=None, max_norm=None, norm_type=None)[source]

Applies lookup table for embedding.

Parameters
  • inp (Tensor) – tensor with indices.

  • weight (Tensor) – learnable weights which embeds from.

  • padding_idx (Optional[int]) – should be set to None, not supported now.

  • max_norm (Optional[float]) – should be set to None, not supported now.

  • norm_type (Optional[float]) – should be set to None, not supported now.

Refer to Embedding for more information.