.. _l-onnx-doc-Equal: ===== Equal ===== .. contents:: :local: .. _l-onnx-op-equal-13: Equal - 13 ========== **Version** * **name**: `Equal (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 tensor resulted from performing the `equal` logical operation elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support). This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX `_. **Inputs** * **A** (heterogeneous) - **T**: First input operand for the logical operator. * **B** (heterogeneous) - **T**: Second input operand for the logical operator. **Outputs** * **C** (heterogeneous) - **T1**: Result tensor. **Type Constraints** * **T** in ( tensor(bfloat16), tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input types to all numeric tensors. * **T1** in ( tensor(bool) ): Constrain output to boolean tensor. **Examples** **default** :: node = onnx.helper.make_node( "Equal", inputs=["x", "y"], outputs=["z"], ) x = (np.random.randn(3, 4, 5) * 10).astype(np.int32) y = (np.random.randn(3, 4, 5) * 10).astype(np.int32) z = np.equal(x, y) expect(node, inputs=[x, y], outputs=[z], name="test_equal") **_equal_broadcast** :: node = onnx.helper.make_node( "Equal", inputs=["x", "y"], outputs=["z"], ) x = (np.random.randn(3, 4, 5) * 10).astype(np.int32) y = (np.random.randn(5) * 10).astype(np.int32) z = np.equal(x, y) expect(node, inputs=[x, y], outputs=[z], name="test_equal_bcast") **Differences** .. raw:: html
00Returns the tensor resulted from performing the equal logical operationReturns the tensor resulted from performing the equal logical operation
11elementwise on the input tensors A and B (with Numpy-style broadcasting support).elementwise on the input tensors A and B (with Numpy-style broadcasting support).
22
33This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check Broadcasting in ONNX _.This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check Broadcasting in ONNX _.
44
55**Inputs****Inputs**
66
77* **A** (heterogeneous) - **T**:* **A** (heterogeneous) - **T**:
88 First input operand for the logical operator. First input operand for the logical operator.
99* **B** (heterogeneous) - **T**:* **B** (heterogeneous) - **T**:
1010 Second input operand for the logical operator. Second input operand for the logical operator.
1111
1212**Outputs****Outputs**
1313
1414* **C** (heterogeneous) - **T1**:* **C** (heterogeneous) - **T1**:
1515 Result tensor. Result tensor.
1616
1717**Type Constraints****Type Constraints**
1818
1919* **T** in (* **T** in (
20 tensor(bfloat16),
2021 tensor(bool), tensor(bool),
2122 tensor(double), tensor(double),
2223 tensor(float), tensor(float),
2324 tensor(float16), tensor(float16),
2425 tensor(int16), tensor(int16),
2526 tensor(int32), tensor(int32),
2627 tensor(int64), tensor(int64),
2728 tensor(int8), tensor(int8),
2829 tensor(uint16), tensor(uint16),
2930 tensor(uint32), tensor(uint32),
3031 tensor(uint64), tensor(uint64),
3132 tensor(uint8) tensor(uint8)
3233 ): ):
3334 Constrain input types to all numeric tensors. Constrain input types to all numeric tensors.
3435* **T1** in (* **T1** in (
3536 tensor(bool) tensor(bool)
3637 ): ):
3738 Constrain output to boolean tensor. Constrain output to boolean tensor.
.. _l-onnx-op-equal-11: Equal - 11 ========== **Version** * **name**: `Equal (GitHub) `_ * **domain**: **main** * **since_version**: **11** * **function**: False * **support_level**: SupportType.COMMON * **shape inference**: True This version of the operator has been available **since version 11**. **Summary** Returns the tensor resulted from performing the `equal` logical operation elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support). This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX `_. **Inputs** * **A** (heterogeneous) - **T**: First input operand for the logical operator. * **B** (heterogeneous) - **T**: Second input operand for the logical operator. **Outputs** * **C** (heterogeneous) - **T1**: Result tensor. **Type Constraints** * **T** in ( tensor(bool), tensor(double), tensor(float), tensor(float16), tensor(int16), tensor(int32), tensor(int64), tensor(int8), tensor(uint16), tensor(uint32), tensor(uint64), tensor(uint8) ): Constrain input types to all numeric tensors. * **T1** in ( tensor(bool) ): Constrain output to boolean tensor. **Differences** .. raw:: html
00Returns the tensor resulted from performing the equal logical operationReturns the tensor resulted from performing the equal logical operation
11elementwise on the input tensors A and B (with Numpy-style broadcasting support).elementwise on the input tensors A and B (with Numpy-style broadcasting support).
22
33This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check Broadcasting in ONNX _.This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check Broadcasting in ONNX _.
44
55**Inputs****Inputs**
66
77* **A** (heterogeneous) - **T**:* **A** (heterogeneous) - **T**:
88 First input operand for the logical operator. First input operand for the logical operator.
99* **B** (heterogeneous) - **T**:* **B** (heterogeneous) - **T**:
1010 Second input operand for the logical operator. Second input operand for the logical operator.
1111
1212**Outputs****Outputs**
1313
1414* **C** (heterogeneous) - **T1**:* **C** (heterogeneous) - **T1**:
1515 Result tensor. Result tensor.
1616
1717**Type Constraints****Type Constraints**
1818
1919* **T** in (* **T** in (
2020 tensor(bool), tensor(bool),
21 tensor(double),
22 tensor(float),
23 tensor(float16),
24 tensor(int16),
2125 tensor(int32), tensor(int32),
2226 tensor(int64) tensor(int64),
27 tensor(int8),
28 tensor(uint16),
29 tensor(uint32),
30 tensor(uint64),
31 tensor(uint8)
2332 ): ):
2433 Constrain input to integral tensors. Constrain input types to all numeric tensors.
2534* **T1** in (* **T1** in (
2635 tensor(bool) tensor(bool)
2736 ): ):
2837 Constrain output to boolean tensor. Constrain output to boolean tensor.
.. _l-onnx-op-equal-7: Equal - 7 ========= **Version** * **name**: `Equal (GitHub) `_ * **domain**: **main** * **since_version**: **7** * **function**: False * **support_level**: SupportType.COMMON * **shape inference**: True This version of the operator has been available **since version 7**. **Summary** Returns the tensor resulted from performing the `equal` logical operation elementwise on the input tensors `A` and `B` (with Numpy-style broadcasting support). This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check `Broadcasting in ONNX `_. **Inputs** * **A** (heterogeneous) - **T**: First input operand for the logical operator. * **B** (heterogeneous) - **T**: Second input operand for the logical operator. **Outputs** * **C** (heterogeneous) - **T1**: Result tensor. **Type Constraints** * **T** in ( tensor(bool), tensor(int32), tensor(int64) ): Constrain input to integral tensors. * **T1** in ( tensor(bool) ): Constrain output to boolean tensor. **Differences** .. raw:: html
00Returns the tensor resulted from performing the equal logical operationReturns the tensor resulted from performing the equal logical operation
11elementwise on the input tensors A and B.elementwise on the input tensors A and B (with Numpy-style broadcasting support).
22
33If broadcasting is enabled, the right-hand-side argument will be broadcastedThis operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>_.
4to match the shape of left-hand-side argument. See the doc of Add for a
5detailed description of the broadcasting rules.
64
7**Attributes**
8
9* **axis**:
10 If set, defines the broadcast dimensions.
11* **broadcast**:
12 Enable broadcasting Default value is 0.
13
145**Inputs****Inputs**
156
167* **A** (heterogeneous) - **T**:* **A** (heterogeneous) - **T**:
178 Left input tensor for the logical operator. First input operand for the logical operator.
189* **B** (heterogeneous) - **T**:* **B** (heterogeneous) - **T**:
1910 Right input tensor for the logical operator. Second input operand for the logical operator.
2011
2112**Outputs****Outputs**
2213
2314* **C** (heterogeneous) - **T1**:* **C** (heterogeneous) - **T1**:
2415 Result tensor. Result tensor.
2516
2617**Type Constraints****Type Constraints**
2718
2819* **T** in (* **T** in (
2920 tensor(bool), tensor(bool),
3021 tensor(int32), tensor(int32),
3122 tensor(int64) tensor(int64)
3223 ): ):
3324 Constrain input to integral tensors. Constrain input to integral tensors.
3425* **T1** in (* **T1** in (
3526 tensor(bool) tensor(bool)
3627 ): ):
3728 Constrain output to boolean tensor. Constrain output to boolean tensor.
.. _l-onnx-op-equal-1: Equal - 1 ========= **Version** * **name**: `Equal (GitHub) `_ * **domain**: **main** * **since_version**: **1** * **function**: False * **support_level**: SupportType.COMMON * **shape inference**: True This version of the operator has been available **since version 1**. **Summary** Returns the tensor resulted from performing the `equal` logical operation elementwise on the input tensors `A` and `B`. If broadcasting is enabled, the right-hand-side argument will be broadcasted to match the shape of left-hand-side argument. See the doc of `Add` for a detailed description of the broadcasting rules. **Attributes** * **axis**: If set, defines the broadcast dimensions. * **broadcast**: Enable broadcasting Default value is ``0``. **Inputs** * **A** (heterogeneous) - **T**: Left input tensor for the logical operator. * **B** (heterogeneous) - **T**: Right input tensor for the logical operator. **Outputs** * **C** (heterogeneous) - **T1**: Result tensor. **Type Constraints** * **T** in ( tensor(bool), tensor(int32), tensor(int64) ): Constrain input to integral tensors. * **T1** in ( tensor(bool) ): Constrain output to boolean tensor.