EmbeddingBagPackedSum

Versioned name: EmbeddingBagPackedSum-3

Category: Sparse

Short description: Computes sums of "bags" of embeddings, without instantiating the intermediate embeddings.

Detailed description: This is the first case of the PyTorch EmbeddingBag, it has indices in the tensor of format [batch, indices_per_bag]. If 3rd input is not provided, this operation is equivalent to Gather followed by ReduceSum(axis=0). However, EmbeddingBagPackedSum is much more time and memory efficient than using a chain of these operations.

Inputs:

Outputs:

Types

Example

<layer ... type="EmbeddingBagPackedSum" ... >
<input>
<port id="0">
<dim>5</dim>
<dim>2</dim>
</port>
<port id="1">
<dim>3</dim>
<dim>2</dim>
</port>
<port id="2"/>
<dim>3</dim>
<dim>2</dim>
</port>
</input>
<output>
<port id="4">
<dim>3</dim>
<dim>2</dim>
</port>
</output>
</layer>