Hi,
indeed, you have me confused.
I thought that you had Embeddings “per seen word” from nn.Embedding (and can afford the memory from it) and wanted a weighted sum over them without an intermediate “multiply with weights” step.
As far as I understand, EmbeddingBag avoids the “per seen word” memory allocation by (in its slow cpu version 15) using Tensor.index_add_. Indeed I am unaware of a way to do this and have the weights applied in the same step.
Best regards
Thomas