Hi,
According to the current implementation: for bags of constant length, nn.EmbeddingBag with mode=sum is equivalent
to  nn.Embedding followed by torch.sum(dim=1). In other words, the embeddings all have the same weight, i.e. 1. I wonder if it is possible to weight the embeddings before summing them up or if there is any efficient way to do so?
Currently what I did is first use nn.Embedding to extract embeddings, then multiply with weights, and finally summing them up. This, however, is very inefficient since we need to instantiate the intermediate embeddings. Is it possible to add such feature? Or perhaps providing some hints on how to do this effectively.
Thanks for the help!