[object Object]

[object Object][object Object]undefined
[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]
  • Description: Computes the mean absolute error (MAE) between each element of input self and 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 [object Object] is [object Object]:

    (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 [object Object] is not [object Object]:

    (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]
  • Parameters:

    • self (aclTensor*, compute input): input [object Object] in the formula, aclTensor on the device. The data types of self and target must meet the type deduction rules (see ). The shape supports 0 to 8 dimensions. The shapes of self and target must meet the . are supported, and the supports ND.
      • [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]: The data type can be FLOAT16, FLOAT32, or INT64.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be BFLOAT16, FLOAT16, FLOAT32, or INT64.
    • target (aclTensor*, compute input): input [object Object] in the formula, aclTensor on the device. The data types of target and self must meet the type deduction rules (see ). The shape supports 0 to 8 dimensions. The shapes of target and self must meet the . are supported, and the supports ND.
      • [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]: The data type can be FLOAT16, FLOAT32, or INT64.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be BFLOAT16, FLOAT16, FLOAT32, or INT64.
    • reduction (int64_t, compute input, attribute): input to be applied to the reduction formula of the output, [object Object] in the formula, an integer on the host. The value can be 0 ('none') | 1 ('mean') | 2 ('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.
    • out (aclTensor*, compute output): [object Object] in the formula, aclTensor on the device. The data type must be convertible from that after deduction between self and target (see ). are supported, and the supports ND. When reduction is 0, the shape of out is the same as the broadcasted shape of self and target. When reduction is not 0, the shape of out supports 0 dimensions.
      • [object Object]Atlas training series products[object Object] and [object Object]Atlas inference series products[object Object]: The data type can be FLOAT16, FLOAT32, INT64, COMPLEX64, or COMPLEX128.
      • [object Object]Atlas A2 training products/Atlas A2 inference products[object Object] and [object Object]Atlas A3 training series products/Atlas A3 inference series products[object Object]: The data type can be BFLOAT16, FLOAT16, FLOAT32, INT64, COMPLEX64, or COMPLEX128.
    • workspaceSize (uint64_t*, output): size of the workspace to be allocated on the device.
    • executor (aclOpExecutor**, output): operator executor, containing the operator computation process.
  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]
[object Object]
  • Parameters:

    • workspace (void*, input): address of the workspace to be allocated on the device.
    • workspaceSize (uint64_t, input): size of the workspace to be allocated on the device, which is obtained by the first-phase API aclnnL1LossGetWorkspaceSize.
    • executor (aclOpExecutor*, input): operator executor, containing the operator computation process.
    • stream (aclrtStream, input): stream for executing the task.
  • Returns:

    aclnnStatus: status code. For details, see .

[object Object]
  • Deterministic compute:
    • aclnnL1Loss defaults to a deterministic implementation.
[object Object]

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

[object Object]