We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
← Tokenization & Embeddings step 1 of 15
Easy
Primitives
Implement Embedding Lookup
Implement an embedding lookup operation.
Given a weight matrix (embedding table) and a list of indices, return the corresponding embedding vectors.
Input:
-
weight: embedding matrix of shape(vocab_size, embed_dim) -
indices: 1D integer tensor of shape(seq_len,)
Output: Tensor of shape (seq_len, embed_dim) with the looked-up embeddings
Nothing accepted yet. When a submission passes, the code that passed shows up
here, one entry per mode.
Stuck?
PyTorch reference solution
Sign in to attempt this problem and reveal the reference solution.