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:
indicates self, indicates target, and indicates the batch size. If reduction is not none:
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.
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]
- 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.
The following example is for reference only. For details, see .