embedding

fun embedding(table: DTensor, indices: IntTensor, paddingIndex: Int = -1): DTensor

The backing operation for the embedding layer.

Accepts:

  • @param table Shape(numEmbeddings, embeddingShape)

  • @param indices Shape(*)

Return

a DTensor of Shape(*, embeddingShape)