Tan
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: computes the tangent value of the input tensor element by element, and the output tensor has the same shape as the input tensor.
-
Computation formula:
yi=tan(xi)y_i = \tan(x_i)
Here, xix_i denotes the ii-th element of the input tensor
x, and yiy_i denotes the ii-th element of the output tensory.
Parameter Description
| Parameter Name | Input/Output/Attribute | Description | Data Type | Data Format |
|---|---|---|---|---|
| x | Input | The input tensor x in the formula. Non-contiguous tensor inputs are automatically converted to contiguous tensors by the framework before execution. | FLOAT16, FLOAT, BFLOAT16, INT32, DOUBLE, COMPLEX64, COMPLEX128 | ND |
| y | Output | The output tensor y in the formula, with the same shape as x. Non-contiguous tensor outputs are automatically converted to contiguous tensors by the framework before execution. | FLOAT16, FLOAT, BFLOAT16, INT32, DOUBLE, COMPLEX64, COMPLEX128 | ND |
- Ascend 950PR&950DT products, Atlas A3 products, and Atlas A2 products: the AI Core supports FLOAT16, FLOAT, BFLOAT16, and INT32.
- Atlas 200I/500 A2 inference products, Atlas inference products, and Atlas training products: the AI Core supports FLOAT16, FLOAT, and INT32, and does not support BFLOAT16.
- DOUBLE, COMPLEX64, and COMPLEX128 are computed through the AICPU path.
Constraint Description
- The shapes of the input and output must be the same, and the data format is ND.
- In the AI Core implementation of Ascend 950PR&950DT products, the output is NaN when the input is NaN or Inf. A finite large input (including an absolute value greater than or equal to 10710^7) is processed through high-precision range reduction and outputs a finite value.
Invocation Description
| Invocation Method | Sample Code | Description |
|---|---|---|
| aclnn API | test_aclnn_tan.cpp | Invokes the Tan operator through the aclnnTan and aclnnInplaceTan APIs. |
| GE graph mode | test_geir_tan.cpp | Invokes the Tan operator by building a graph through the operator IR. |