Real
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 | × |
Function Description
-
Operator function: returns the real part of each element in the input tensor.
-
Computation formula:
outputi=Re(inputi)output_i = \mathrm{Re}(input_i)
where:
- When inputi=ai+bi⋅jinput_i = a_i + b_i \cdot j is a complex number, outputi=aioutput_i = a_i;
- When inputiinput_i is a real number, outputi=inputioutput_i = input_i (pass-through).
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| input | Input | Input tensor for real part extraction, which is $input_i$ in the formula. | FLOAT, FLOAT16, COMPLEX64, COMPLEX32 | ND |
| Tout | Optional Attribute |
|
INT | - |
| output | Output | Output tensor after real part extraction, which is $output_i$ in the formula. The shape is the same as that of input. | FLOAT, FLOAT16 | ND |
Correspondence between input and output dtypes:
| input | output |
|---|---|
| FLOAT | FLOAT |
| FLOAT16 | FLOAT16 |
| COMPLEX64 | FLOAT |
| COMPLEX32 | FLOAT16 |
Constraint Description
None
Invocation Description
| Invocation Method | Invocation Sample | Description |
|---|---|---|
| aclnn invocation | test_aclnn_real | Invokes the Real operator through the aclnnReal API. |
| Graph-mode invocation | test_geir_real | Invokes the Real operator by building a graph through the operator IR. |