torch:embedding
(torch:embedding num-embeddings embedding-dim)
Returns an embedding table (PyTorch's nn.Embedding): the single field :weight, a (num-embeddings embedding-dim) parameter drawn from the standard normal like PyTorch's default. The forward takes integer indices of any shape and returns them with the embedding axis appended; a row selected twice accumulates both gradients (torch:index-select's adjoint).