[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Performs backward pass of .

  • Formula (using 5D input as an example):

    1. Multiply the input [object Object] of shape (N1, N2, N3, N4, N4) with the input [object Object] (forward output).out_mul=gradOutputgradSelfout\_mul = gradOutput * gradSelf
    2. Generate a BOOL triangular matrix A of shape (N4, N4), where the upper triangle is [object Object], the lower triangle is [object Object], and the diagonal is [object Object].
    3. Fill the elements in out_mulout\_mul with [object Object] at the positions where the corresponding elements in matrix A are [object Object].out_muli={out_muli,Ai==False0,Ai==Trueout\_mul_i= \begin{cases}out\_mul_i,\quad A_i==False \\0, \quad A_i==True \end{cases}
    4. Reverse the second-to-last dimension of [object Object] to generate [object Object].
    5. Perform a cumulative sum along the second-to-last dimension of [object Object]. For an element from a dimensional perspective, other dimension indices remain unchanged while the current index increases. out_cumsum_iout\_cumsum\_{i} is the element at the corresponding position in the output tensor.out_cumsumi=out_flip1+out_flip2+out_flip3+......+out_flipiout\_cumsum_{i} = out\_flip_{1} + out\_flip_{2} + out\_flip_{3} + ...... + out\_flip_{i}
    6. Reverse the second-to-last dimension of out_cumsumout\_cumsum to generate [object Object].
    7. Generate a BOOL triangular matrix B of shape (N4, N4), where the upper triangle is [object Object], the lower triangle is [object Object], and the diagonal is [object Object].
    8. Fill the elements in out_flip2out\_flip2 with [object Object] at the positions where the corresponding elements in matrix B are [object Object].out_flip2i={out_flip2i,Bi==False0,Bi==Trueout\_flip2_i= \begin{cases}out\_flip2_i,\quad B_i==False \\0, \quad B_i==True \end{cases}
    9. Return [object Object] as the sum of each row along the last dimension of [object Object].
[object Object]

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

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

    [object Object]
  • Returns:

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

    The first-phase API performs input parameter validation. The following errors may be returned:

    [object Object]
[object Object]
  • Parameters:

    [object Object]
  • Returns:

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

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

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

[object Object]