Revise NonZero op - specification (#5804)

* Revise spec for nonzero op

* Applying suggestions from review comments

* Change naming in detailed description, using tuple instead of column.

* add missing newlines in attributes section

* Remove trailing space from line 7
This commit is contained in:
Bartosz Lesniewski
2021-06-03 13:18:01 +02:00
committed by GitHub
parent 5f3144c700
commit 9384cfefc6

View File

@@ -7,31 +7,35 @@
**Short description**: *NonZero* returns the indices of the non-zero elements of the input tensor.
**Detailed description**: *NonZero* returns the indices of the non-zero elements of the input tensor (in row-major order - by dimension).
The output tensor has shape `[rank(input), num_non_zero]`. For example, for the tensor `[[1, 0], [1, 1]]` the output will be `[[0, 1, 1], [0, 0, 1]]`.
* The output tensor has shape `[rank(input), num_non_zero]`.
* For example, for the tensor `[[1, 0], [1, 1]]` the output will be `[[0, 1, 1], [0, 0, 1]]`.
* The output is a collection of tuples, each tuple has `rank(input)` elements and contains indices for a single non-zero element.
* The `i`'th element of each output dimension is a part of `i`'th tuple.
* In given example the tuples would be: `[0, 0]`, `[1, 0]`, `[1, 1]`.
**Attributes**
* *output_type*
* **Description**: the output tensor type
* **Range of values**: "i64" or "i32"
* **Range of values**: `i64` or `i32`
* **Type**: string
* **Default value**: "i64"
* **Required**: *No*
**Inputs**:
* **1**: `data` tensor of arbitrary rank of type *T*. Required.
* **1**: A tensor of type *T* and arbitrary shape. **Required**.
**Outputs**:
* **1**: tensor with indices of non-zero elements of shape `[rank(data), num_non_zero]` of type *T_IND*.
* **1**: tensor with indices of non-zero elements of shape `[rank(data), num_non_zero]` of type *T_OUT*.
**Types**
* *T*: any type.
* *T_IND*: `int64` or `int32`.
* *T_OUT*: Depending on *output_type* attribute can be `int64` or `int32`.
**Example**
@@ -53,4 +57,4 @@ The output tensor has shape `[rank(input), num_non_zero]`. For example, for the
</port>
</output>
</layer>
```
```