Add
English | 简体中文
Product Support Status
| Product | Supported |
|---|---|
| Ascend 950PR&950DT products | √ |
| Atlas A3 products | √ |
| Atlas A2 products | √ |
| Atlas 200I/500 A2 inference products | × |
| Atlas inference products | × |
| Atlas training products | √ |
| Kirin X90 processor series products | √ |
| Kirin 9030 processor series products | √ |
Function Description
- Operator function: adds the inputs.
- Computation formula:
y=x1+x2y = x_1 + x_2
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x1 | Input | The input tensor x_1 in the formula | BOOL, INT8, INT16, INT32, INT64, UINT8, FLOAT64, FLOAT16, BFLOAT16, FLOAT32, COMPLEX128, COMPLEX64 | ND |
| x2 | Input | The input tensor x2 in the formula | Same as x1 | ND |
| y | Output | The output tensor y in the formula | Same as x1 | ND |
Constraint Description
- The STRING data type is not supported. Registering DT_STRING in the operator IR (add_proto.h) is only for compatibility with the TensorFlow Add operator. Although the graph-mode (GEIR) invocation path can pass type inference, no corresponding kernel implementation exists, and execution fails at runtime.
- COMPLEX32 is supported only by the kernel implementation of Ascend 950. Neither the aclnnAdd / aclnnInplaceAdd APIs nor the graph-mode path supports it. Use COMPLEX64 / COMPLEX128 instead.
- Kirin X90/Kirin 9030 processor series products support the INT8, UINT8, INT32, FLOAT16, and FLOAT32 data types
Invocation Description
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| aclnn invocation | test_aclnn_add | Invokes the Add operator through the aclnnAdd and aclnnInplaceAdd APIs |
| Graph-mode invocation | test_geir_add | Invokes the Add operator by building a graph through the operator IR |