Formula (using 5D input as an example):
- Multiply the input
[object Object]of shape (N1, N2, N3, N4, N4) with the input[object Object](forward output). - 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]. - Fill the elements in with
[object Object]at the positions where the corresponding elements in matrix A are[object Object]. - Reverse the second-to-last dimension of
[object Object]to generate[object Object]. - 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. is the element at the corresponding position in the output tensor. - Reverse the second-to-last dimension of to generate
[object Object]. - 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]. - Fill the elements in with
[object Object]at the positions where the corresponding elements in matrix B are[object Object]. - Return
[object Object]as the sum of each row along the last dimension of[object Object].
- Multiply the input
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]
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]
- Deterministic computation:
[object Object]defaults to a deterministic implementation.
The following example is for reference only. For details, see .
[object Object]