FilesLast commitLast update
5 months ago
2 months ago
1 month ago
1 month ago
1 month ago
1 month ago
11 days ago
11 days ago
README

AcoshGrad

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 backward gradient of the Acosh (inverse hyperbolic cosine) operator.

  • Operator formula:

    zi=dyi⋅1yi2−1z_i = dy_i \cdot \dfrac{1}{\sqrt{y_i^2 - 1}}

    where:

    • yiy_i is the input tensor of the forward Acosh operator, and its value range is expected to be ≥1\geq 1;
    • dyidy_i is the gradient passed from upstream;
    • ziz_i is the gradient with respect to the original input tensor, which equals the upstream gradient multiplied by 1/yi2−11/\sqrt{y_i^2 - 1}.
  • Boundary (yi≤1y_i \leq 1): when yi=1y_i = 1, 0=0\sqrt{0}=0, and division by zero results in +Inf+\text{Inf}; when yi<1y_i < 1, the square root of a negative number results in NaN, which propagates naturally according to IEEE 754. It is recommended that the value range of the input yy fall within [1,+∞)[1, +\infty) to avoid Inf or NaN results.

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
y Input The input tensor of the forward Acosh operator. The value range is expected to fall within [1, +∞). FLOAT16, FLOAT32, BFLOAT16 ND
dy Input The gradient tensor passed from upstream, whose shape and dtype are the same as those of y. FLOAT16, FLOAT32, BFLOAT16 ND
z Output The gradient with respect to the original input tensor, whose shape and dtype are the same as those of y. FLOAT16, FLOAT32, BFLOAT16 ND

Constraint Description

  • The shapes of y and dy must be exactly the same.
  • The dtypes of y and dy must be exactly the same.
  • Only the ND format is supported.
  • Dynamic shape is supported: the shape is determined at runtime, and dynamic shape and dynamic rank (rank range 0 to 8) are supported. The shapes of y/dy/z must be exactly the same.
  • For an empty tensor (with 0 elements), an empty result is returned directly.
  • Non-contiguous tensors are supported, and the number of dimensions of a non-contiguous tensor cannot be greater than 8.

Invocation Description

Invocation Method Invocation Sample Description
Graph-mode invocation test_geir_acosh_grad Invokes the AcoshGrad operator by building a graph through the operator IR.