[object Object]

[object Object][object Object]undefined
[object Object]
  • This API is used to calculate the mean absolute error (MAE) between each element in the input self and the target. reduction specifies the reduction to be applied to the output. The value can be none, mean, or sum. none indicates that no reduction is applied; mean indicates that the sum of the output will be divided by the number of elements in the output; sum indicates that the output will be summed.

  • Formula:

    If reduction is none:

    (x,y)=L={l1,,lN},ln=xnyn,\ell(x, y) = L = \{l_1,\dots,l_N\}^\top, \quad l_n = \left| x_n - y_n \right|,

    xx indicates self, yy indicates target, and NN indicates the batch size. If reduction is not none:

    (x,y)={mean(L),if reduction=’mean’;sum(L),if reduction=’sum’.\ell(x, y) = \begin{cases} \operatorname{mean}(L), & \text{if reduction} = \text{'mean';}\\ \operatorname{sum}(L), & \text{if reduction} = \text{'sum'.} \end{cases}
[object Object]

Each operator has calls. First, aclnnL1LossGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnL1Loss 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 implements input parameter validation. The following error codes may be returned.

    [object Object]
[object Object]
  • Parameters

    [object Object]
  • Returns

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

[object Object]
  • Deterministic computation:
    • aclnnL1Loss defaults to a deterministic implementation.
  • In LpLoss, p is the parameter for calculating the loss. Only p = 1 is supported. The aclnn API name is aclnnL1Loss.
[object Object]

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

[object Object]