Skip to content
masterclass Buddy

TensorFlow · Class

layers.Embedding

tf.keras.layers.Embedding maps nonnegative integer indexes to dense vectors. It is commonly used to turn token IDs into vector sequences before a sequence-processing layer.

Last updated

Syntax

tf.keras.layers.Embedding(input_dim, output_dim, embeddings_initializer='uniform', embeddings_regularizer=None, embeddings_constraint=None, mask_zero=False, weights=None, lora_rank=None, lora_alpha=None, quantization_config=None, **kwargs)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • keras.layers.Masking
  • keras.layers.TextVectorization
  • keras.layers.GRU
  • keras.layers.LSTM
  • enable_lora
  • compute_mask

Source: tf.keras.layers.Embedding | TensorFlow v2.21.0. Checked 2026-11-03.