FilesLast commitLast update
21 days ago
2 months ago
3 months ago
26 days ago
25 days ago
7 days ago
14 days ago
26 days ago
22 days ago
1 month ago
1 month ago
13 days ago
README

TanhGrad

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: backward implementation of Tanh.

  • Computation formula:

d=tanh(x)=(ex−e−xex+e−x)(1)d = tanh(x)= (\frac{e^{x} - {e^{-x}}}{e^{x} + {e^{-x}}}) \tag{1}

dy=1−tan(x)2(2)dy = 1 -tan(x)^2 \tag{2}

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
y Input Output of the forward computation. FLOAT16, FLOAT, DOUBLE, BFLOAT16, COMPLEX64, COMPLEX128 ND
dy Input Gradient of the previous operator in the backward pass. FLOAT16, FLOAT, DOUBLE, BFLOAT16, COMPLEX64, COMPLEX128 ND
complex_conj Optional attribute Indicates whether to perform the conjugate operation on the complex type. BOOL -
z Output Output of the backward computation. FLOAT16, FLOAT, DOUBLE, BFLOAT16, COMPLEX64, COMPLEX128 ND

Constraint Description

None

Invocation Description

Invocation Method Invocation Sample Description
aclnn invocation test_aclnn_tanh_backward Invokes the Abs operator through the aclnnTanhBackward API.