Function: performs segmentation and computation. Generates a semi-separable matrix with the diagonal being 0 and the upper triangle being -inf.
Formula (using 4D input as an example):
Reshape
[object Object]from (N1, N2, N3, N4) to (N1, N2, N3, N4, 1).Perform broadcasting obtain (N1, N2, N3, N4, N4).
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
[object Object]with[object Object]at the positions where the corresponding elements in matrix A are[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.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
[object Object]with[object Object]at the positions where the corresponding elements in matrix B are[object Object].Compute the exponent of each element in
[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.
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 .