NonZero#
NonZero - 13#
Version
name: NonZero (GitHub)
domain: main
since_version: 13
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 13.
Summary
Returns the indices of the elements that are non-zero (in row-major order - by dimension). NonZero behaves similar to numpy.nonzero: https://docs.scipy.org/doc/numpy/reference/generated/numpy.nonzero.html
Inputs
X (heterogeneous) - T: input
Outputs
Y (heterogeneous) - tensor(int64): output
Type Constraints
T in ( tensor(bfloat16), tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain to all tensor types.
Examples
Differences
0 | 0 | Returns the indices of the elements that are non-zero | Returns the indices of the elements that are non-zero |
1 | 1 | (in row-major order - by dimension). | (in row-major order - by dimension). |
2 | 2 | NonZero behaves similar to numpy.nonzero: | NonZero behaves similar to numpy.nonzero: |
3 | 3 | https://docs.scipy.org/doc/numpy/reference/generated/numpy.nonzero.html | https://docs.scipy.org/doc/numpy/reference/generated/numpy.nonzero.html |
4 | 4 |
|
|
5 | 5 | **Inputs** | **Inputs** |
6 | 6 |
|
|
7 | 7 | * **X** (heterogeneous) - **T**: | * **X** (heterogeneous) - **T**: |
8 | 8 | input | input |
9 | 9 |
|
|
10 | 10 | **Outputs** | **Outputs** |
11 | 11 |
|
|
12 | 12 | * **Y** (heterogeneous) - **tensor(int64)**: | * **Y** (heterogeneous) - **tensor(int64)**: |
13 | 13 | output | output |
14 | 14 |
|
|
15 | 15 | **Type Constraints** | **Type Constraints** |
16 | 16 |
|
|
17 | 17 | * **T** in ( | * **T** in ( |
18 | tensor(bfloat16), | ||
18 | 19 | tensor(bool), | tensor(bool), |
19 | 20 | tensor(complex128), | tensor(complex128), |
20 | 21 | tensor(complex64), | tensor(complex64), |
21 | 22 | tensor(double), | tensor(double), |
22 | 23 | tensor(float), | tensor(float), |
23 | 24 | tensor(float16), | tensor(float16), |
24 | 25 | tensor(int16), | tensor(int16), |
25 | 26 | tensor(int32), | tensor(int32), |
26 | 27 | tensor(int64), | tensor(int64), |
27 | 28 | tensor(int8), | tensor(int8), |
28 | 29 | tensor(string), | tensor(string), |
29 | 30 | tensor(uint16), | tensor(uint16), |
30 | 31 | tensor(uint32), | tensor(uint32), |
31 | 32 | tensor(uint64), | tensor(uint64), |
32 | 33 | tensor(uint8) | tensor(uint8) |
33 | 34 | ): | ): |
34 | 35 | Constrain to all tensor types. | Constrain to all tensor types. |
NonZero - 9#
Version
name: NonZero (GitHub)
domain: main
since_version: 9
function: False
support_level: SupportType.COMMON
shape inference: True
This version of the operator has been available since version 9.
Summary
Returns the indices of the elements that are non-zero (in row-major order - by dimension). NonZero behaves similar to numpy.nonzero: https://docs.scipy.org/doc/numpy/reference/generated/numpy.nonzero.html
Inputs
X (heterogeneous) - T: input
Outputs
Y (heterogeneous) - tensor(int64): output
Type Constraints
T in ( tensor(bool), tensor(complex128), tensor(complex64), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(string), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain to all tensor types.