FilesLast commitLast update
2 months ago
2 months ago
29 days ago
2 months ago
2 months ago
29 days ago
1 month ago
14 days ago
README

ReciprocalGrad

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 gradient of the Reciprocal operator. y = Reciprocal(x) = 1/x, dy is the upstream gradient, and z is the gradient with respect to the input x.
  • Computation formula:

z=−y×y×dyz = -y \times y \times dy

Parameter Description

Parameter Name Input/Output/Attribute Description Data Type Data Format
y Input y in the formula, the output of the forward Reciprocal operator. FLOAT, FLOAT16, BFLOAT16 ND
dy Input dy in the formula, the upstream gradient. FLOAT, FLOAT16, BFLOAT16 ND
z Output z in the formula, the gradient with respect to the input x. FLOAT, FLOAT16, BFLOAT16 ND
  • Atlas training products and Atlas inference products: BFLOAT16 is not supported.

Constraint Description

  • The data types of y, dy, and z must be the same.
  • The shapes of y, dy, and z must be the same.
  • Only the ND data format is supported.
  • The shape has no more than 8 dimensions.

Invocation Description

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