[object Object]

[object Object][object Object]undefined
[object Object]

Each operator has calls. First, aclnnL1LossBackwardGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnL1LossBackward is called to perform computation.

  • [object Object]
  • [object Object]
[object Object]
  • Description: Performs backpropagation of . reduction specifies the calculation method of the loss function. It can be set to 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.
[object Object]
  • Parameters:

    • gradOutput (aclTensor*, compute input): gradient backward input, the input [object Object] in the formula, and aclTensor on the device. Its data type and the data type of self and target must meet the type deduction rules (see ). Its shape and the shape of self and target must meet the . The shape must be less than nine dimensions. 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 or FLOAT32.
      • [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, or FLOAT32.
    • self (aclTensor*, compute input): input [object Object] in the formula, aclTensor on the device. Its data type and the data type of gradOutput and target must meet the type deduction rules (see ). Its shape and the shape of gradOutput and target must meet the . The shape must be less than nine dimensions. 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 or FLOAT32.
      • [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, or FLOAT32.
    • target (aclTensor*, compute input): input [object Object] in the formula, aclTensor on the device. Its data type and the data type of self and gradOutput must meet the type deduction rules (see ). Its shape and the shape of gradOutput and self must meet the . The shape must be less than nine dimensions. 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 or FLOAT32.
      • [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, or FLOAT32.
    • reduction (int64_t, compute input): calculation method of the loss function, 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.
    • gradInput (aclTensor*, compute output): output [object Object] in the formula, aclTensor on the device. Its data type and the data type of self must meet the type deduction rules (see ). Its shape and the shape of target, self, and gradOutput must meet the . The shape must be less than nine dimensions. 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 or FLOAT32.
      • [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, or FLOAT32.
    • 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 aclnnL1LossBackwardGetWorkspaceSize.
    • 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:
    • aclnnL1LossBackward defaults to a deterministic implementation.
[object Object]

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

[object Object]