FilesLast commitLast update
2 months ago
3 months ago
2 months ago
16 days ago
2 months ago
2 months ago
2 months ago
16 days ago
9 days ago
9 days ago
README

InvGrad

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 Inv (reciprocal) operator, corresponding to the gradient computation of the forward y = 1 / original_x.

  • Operator formula:

    yi=−1⋅xi⋅xi⋅gradiy_i = -1 \cdot x_i \cdot x_i \cdot grad_i

    where:

    • xix_i is the output of the forward Inv operator (that is, 1/original_xi1 / \mathrm{original\_x}_i);
    • gradigrad_i is the gradient passed from upstream;
    • yiy_i is the gradient of the original input original_xi\mathrm{original\_x}_i.

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
x Input Input tensor. FLOAT16, FLOAT32, BFLOAT16, INT32, INT8 ND
grad Input Corresponding input gradient. FLOAT16, FLOAT32, BFLOAT16, INT32, INT8 ND
y Output Derivative gradient of the input tensor x FLOAT16, FLOAT32, BFLOAT16, INT32, INT8 ND

Constraint Description

None

Invocation Description

Invocation Method Sample Code Description
Graph-mode invocation test_geir_inv_grad Invokes the inv_grad operator by building a graph through the operator IR.