EmbeddingSegmentsSum

Versioned name: EmbeddingSegmentsSum-3

Category: Sparse

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

Detailed description: This is sparse.segment_sum operation from Tensorflow. For each index in indices this operator gets values from data embedding table and sums all values belonging to each segment. Values in segment_ids define which segment index in indices tensor belong to, e.g. segments_ids with value [0,0,0,1,1,3,5,5] define 4 non empty segments other segments are empty, the number of segments is defined by num_segments input.

Inputs:

Outputs:

Types

Example

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