Have a question? Connect with the community at the TensorFlow Forum Visit Forum


Performs an embedding lookup for MobileBERT.

This layer includes word embedding, token type embedding, position embedding.

word_vocab_size Number of words in the vocabulary.
word_embed_size Word embedding size.
type_vocab_size Number of word types.
output_embed_size Embedding size for the final embedding output.
max_sequence_length Maximum length of input sequence.
normalization_type String. The type of normalization_type, only 'no_norm' and 'layer_norm' are supported.
initializer The initializer to use for the embedding weights and linear projection weights.
dropout_rate Dropout rate.
**kwargs keyword arguments.



View source

This is where the layer's logic lives.

Note here that call() method in tf.keras is little bit different from keras API. In keras API, you can pass support masking for layers as additional arguments. Whereas tf.keras has compute_mask() method to support masking.

inputs Input tensor, or list/tuple of input tensors.
*args Additional positional arguments. Currently unused.
**kwargs Additional keyword arguments. Currently unused.

A tensor or list/tuple of tensors.