Performs logistic regression Tanh element-wise using the following formula, where PAR indicates the number of elements that can be processed by a vector unit in one iteration.


template <typename T, bool isReuseSource = false> __aicore__ inline void Tanh(const LocalTensor<T>& dstTensor, const LocalTensor<T>& srcTensor, const uint32_t calCount)
Table 1 Template parameters
| Parameter | Description |
|---|---|
| T | Operand data type. The supported data types are half and float. |
| isReuseSource | Whether the source operand can be modified. This parameter is reserved. Pass the default value false. |
Table 2 API parameters
| Parameter | Input/Output | Description |
|---|---|---|
| dstTensor | Output | Destination operand. The type is LocalTensor, and the supported TPosition is VECIN, VECCALC, or VECOUT. |
| srcTensor | Input | Source operand. The type is LocalTensor, and the supported TPosition is VECIN, VECCALC, or VECOUT. |
| calCount | Input | Number of elements involved in the computation. |
Kirin 9020 series processors
Kirin 9030 series processors
Kirin X90 series processors
For details about the alignment requirements of the operand address offset, see General Constraints.
The length of the data involved in computation of the input and output operands must be 32-byte aligned.