[object Object]

[object Object][object Object]undefined
[object Object]
  • 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):

    1. Reshape [object Object] from (N1, N2, N3, N4) to (N1, N2, N3, N4, 1).

    2. Perform broadcasting obtain (N1, N2, N3, N4, N4).

    3. 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].

    4. Fill the elements in [object Object] with [object Object] at the positions where the corresponding elements in matrix A are [object Object].

      selfi={selfi,Ai==False0,Ai==Trueself_i= \begin{cases}self_i,\quad A_i==False \\0, \quad A_i==True \end{cases}
    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. selfTemp_iselfTemp\_{i} is the element at the corresponding position in the output tensor.

      selfTempi=self1+self2+self3+......+selfiselfTemp_{i} = self_{1} + self_{2} + self_{3} + ...... + self_{i}
    6. 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].

    7. Fill the elements in [object Object] with [object Object] at the positions where the corresponding elements in matrix B are [object Object].

      outi={selfTempi,Bi==Falseinf,Bi==Trueout_i= \begin{cases}selfTemp_i,\quad B_i==False \\-inf, \quad B_i==True \end{cases}
    8. Compute the exponent of each element in [object Object].

      outi=eselfTempiout_i=e^{selfTemp_i}
[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]