Operator function: Computes the tangent of each element in the input tensor
[object Object]and stores the result in the output tensor[object Object].Formula:
Example:
[object Object]
[object Object] and [object Object] implement the same function in different ways. Select a proper operator based on your requirements.
[object Object]: An output tensor object needs to be created to store the computation result.[object Object]: No output tensor object needs to be created, and the computation result is stored in the memory of the input tensor.
Each operator has calls. First, [object Object] or [object Object] is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, [object Object] or [object Object] is called to perform computation.
Parameters
[object Object]- For [object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object], BFLOAT16, COMPLEX32, and COMPLEX64 are not supported.
Returns
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown:
[object Object]
Parameters
[object Object]- [object Object]Atlas training products[object Object] and [object Object]Atlas inference products[object Object]: BFLOAT16, COMPLEX32, and COMPLEX64 are not supported.
Returns
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown:
[object Object]
- Deterministic computation:
[object Object]and[object Object]default to deterministic implementation.[object Object]Atlas A3 training products/Atlas A3 inference products[object Object]: The input data of the FLOAT, BFLOAT16, FLOAT16, INT32, and INT64 types must be within the range of [–65504, 65504] to ensure the required precision. If the value is out of the range, the precision cannot be ensured. In this case, use the CPU for computation. Excessive computation load may cause the operator to time out (AI Core error, errorStr: "timeout or trap error"). This typically occurs when the product of the last two dimensions is less than 16 while the product of the leading dimensions is excessively large.
The following example is for reference only. For details, see .
aclnnTan API call example:
aclnnInplaceTan API call example: