我要评分
获取效率
正确性
完整性
易理解

Function Description

Function

Map an integer index to a fixed-size vector.

Formula

Where,

  • x is the input integer index.
  • W is a 2D tensor with shape [num_embeddings, embedding_dim], where each row represents an embedding vector.
  • W[x] denotes retrieving the row with index x from the weight matrix W to serve as the embedding vector.