[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Performs backpropagation of .

  • Formula:

    GLU(a,b)(a,b)=cat(σ(b),σ(b)a(1σ(b)))\frac{\partial GLU(a,b)}{\partial(a,b)}=cat(\sigma(b),\sigma(b) \otimes a \otimes (1-\sigma(b)))
  • Mathematical expression:

    Assume that the output GLUGrad consists of two parts: out = [a_grad, b_grad]. sig_b = sigmoid(b) a_grad=y_gradsig_b b_grad=a_grad(a-a*sig_b) y_grad indicates gradOut, a indicates the first tensor after the input tensor is evenly divided based on the specified dim, and b indicates the second tensor.

[object Object]

Each operator has calls. First, aclnnGluBackwardGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnGluBackward is called to perform computation.

[object Object]
[object Object]
[object Object]
  • Parameters

    [object Object]
    • [object Object]Atlas inference products[object Object] and [object Object]Atlas training products[object Object]: The data type can be DOUBLE, FLOAT, or FLOAT16.
  • Returns

    [object Object]: status code. For details, see .

    The first-phase API implements input parameter validation. The following error codes may be returned.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic computation:
    • aclnnGluBackward defaults to a deterministic implementation.
[object Object]

The following example is for reference only. For details, see .

[object Object]