[object Object]

[object Object][object Object]undefined
[object Object]
  • [object Object] is used to calculate the cumulative product of the input tensor along the specified dimension. For example, if a tensor represents a series of values, [object Object] can calculate the product sequence of these values from the start position to the current position.

  • Formulas:

    • One-dimensional tensor (vector) For a one-dimensional tensor, the cumulative product y=[y1,y2,y3...,yn]y=[y_1,y_2,y_3...,y_n] is calculated as follows:

      y1=x1y_1=x_1 y2=x1×x2y_2=x_1 \times x_2 y3=x1×x2×x3y_3=x_1 \times x_2\times x_3 ... yn=x1×x2×x3×xny_n=x_1\times x_2\times x_3\times x_n

      yi=j=1ixjy_i=\prod_{j=1}^ix_j, where i=1,2...,ni=1,2...,n.

    • High-dimensional tensor (using a two-dimensional tensor as an example, dim=0 along the row direction) For a two-dimensional tensor:

      X=[x11x12...x1mx21x22...x2m............xn1xn2...xnm]X=\begin{bmatrix}x_{11}&x_{12}&...&x_{1m}\\x_{21}&x_{22}&...&x_{2m}\\...&...&...&...&\\x_{n1}&x_{n2}&...&x_{nm}&\end{bmatrix}

      The result tensor after calculation is as follows:

      Y=[y11y12...y1my21y22...y2m............yn1yn2...ynm]Y=\begin{bmatrix}y_{11}&y_{12}&...&y_{1m}\\y_{21}&y_{22}&...&y_{2m}\\...&...&...&...&\\y_{n1}&y_{n2}&...&y_{nm}&\end{bmatrix}

      For the first column (j = 1):

      yi1=x11×x21×...×xi1(fori=1,2,...,n)y_{i1}=x_{11}\times x_{21}\times ...\times x_{i1} (for i = 1, 2,..., n)

      Therefore, for any column j, the following rule also applies:

      yij=k=1ixkjy_{ij}=\prod_{k=1}^{i} x_{kj}
    • High-dimensional tensor (using a two-dimensional tensor as an example, dim=1 along the column direction) Therefore, for any column j, the following rule also applies:

      yij=k=1jxiky_{ij}=\prod_{k=1}^{j} x_{ik}
    • Other parameters can be deduced based on the preceding rules.

[object Object]

aclnnCumprod and aclnnInplaceCumprod provide the same functionality. The differences are as follows. Select the appropriate operator based on your actual scenario.

  • aclnnCumprod: You need to create an output tensor object to store the computation result.
  • aclnnInplaceCumprod: You do not need to create an output tensor object. Instead, the computation result is directly stored in the memory of the input tensor.

Each operator is divided into two phases (../common/two_phase_api.md). You must call aclnnCumprodGetWorkspaceSize or aclnnInplaceCumprodGetWorkspaceSize to obtain the workspace size required for computation and the executor that contains the operator computation process, and then call aclnnCumprod or aclnnInplaceCumprod to perform the computation.

[object Object]
[object Object]
[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]
  • 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] and [object Object] default to a deterministic implementation.
[object Object]

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

[object Object]