Skip to content

Commit

Permalink
Apply CR
Browse files Browse the repository at this point in the history
Signed-off-by: p-wysocki <[email protected]>
  • Loading branch information
p-wysocki committed Jan 23, 2025
1 parent a5b4c01 commit ceb3d15
Showing 1 changed file with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SegmentMax
===================
==========


.. meta::
Expand All @@ -24,32 +24,29 @@ For example ``segments_ids`` with value ``[0,0,0,1,1,3,5,5]`` defines 4 non-empt
* Segment_4: ``[]``
* Segment_5: ``[data[6], data[7]]``

When there are no values in a segment, ``output[segment]`` is set to 0.
When there are no values in a segment, ``output[segment]`` is defined by ``empty_segment_value`` input.

In that case, the output would be ``[max(Segment_0), max(Segment_1), 0, max(Segment_3), 0, max(Segment_5)]``.

**Attributes**:

SegmentMax-16 has no attributes.
* **1**: *empty_segment_value*

**Inputs**
* **Description**: The value assigned to segments which are empty. **Required.**
* **Range of values**: A scalar.
* **Type**: *T*

* **1**: *data*
**Inputs**

* **Description**: The numerical data on which SegmentMax operation will be performed. **Required.**
* **Range of values**: An ND tensor of type *T*.
* **Type**: *T*
* **1**: ``data`` - ND tensor of type *T*, the numerical data on which SegmentMax operation will be performed. **Required.**

* **2**: *segment_ids*
* **2**: ``segment_ids`` - 1D Tensor of sorted non-negative numbers of type *T_IDX*. Its size is equal to the size of the first dimension of the ``data`` input tensor. The values must be smaller than ``num_segments``. **Required.**

* **Description**: Controls how the data is divided into segments. **Required.**
* **Range of values**: 1D tensor of non-negative, sorted integer numbers. Its size is equal to the size of the first dimension of the input tensor.
* **Type**: *T_IDX*
* **4**: ``num_segments`` - A scalar value of type *T_IDX* representing the segments count, used for shape inference. **Optional.**

**Outputs**

* **1**: The output tensor of type *T* and almost the same shape as the ``data`` input tensor with the exception for the first dimension, which is equal to the count of unique segment IDs (calculated as ``max(segment_ids) + 1``).

* **1**: The output tensor has same rank and dimensions as the ``data`` input tensor except for the first dimension which is calculated as ``max(segment_ids) + 1``
**Types**

* *T*: any supported numerical data type.
Expand All @@ -63,16 +60,20 @@ SegmentMax-16 has no attributes.
:force:
<layer ... type="SegmentMax" ... >
<data empty_segment_value="0">
<input>
<port id="0" precision="F32"> <!-- data -->
<dim>8</dim>
</port>
<port id="1" precision="I32"> <!-- segment_ids with 4 unique segment IDs -->
<dim>8</dim>
</port>
<port id="2" precision="I32"> <!-- number of segments -->
<dim>0</dim>
</port>
</input>
<output>
<port id="2" precision="F32">
<port id="3" precision="F32">
<dim>4</dim>
</port>
</output>
Expand All @@ -84,6 +85,7 @@ SegmentMax-16 has no attributes.
:force:
<layer ... type="SegmentMax" ... >
<data empty_segment_value="0">
<input>
<port id="0" precision="I32"> <!-- data -->
<dim>3</dim>
Expand Down

0 comments on commit ceb3d15

Please sign in to comment.