[object Object]

[object Object][object Object]undefined
[object Object]
  • Description: Performs backpropagation of .

  • Formula:

    If [object Object] is [object Object]:

    MselossBackward(grad,x,y)=grad(xy)2/x.numel()MselossBackward(grad, x, y) = grad * (x - y) * 2 / x.numel()

    [object Object] indicates the number of elements in [object Object]. If [object Object] is not [object Object]:

    MselossBackward(grad,x,y)=grad(xy)2MselossBackward(grad, x, y) = grad * (x - y) * 2
[object Object]

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

  • [object Object]
  • [object Object]
[object Object]
  • Parameters:

    • gradOutput (aclTensor*, compute input): input [object Object] in the formula, aclTensor on the device. The data types of gradOutput, self, and target are the same. The shapes of gradOutput, self, and target meet the . are supported. The can be ND. The shape supports zero to eight dimensions.

      • [object Object]Atlas inference series products[object Object] and [object Object]Atlas training series products[object Object]: The data type can be FLOAT16 or FLOAT.
      • [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 FLOAT.
    • self (aclTensor*, compute input): input [object Object] in the formula, aclTensor on the device. The data types of gradOutput, self, and target are the same. The shapes of gradOutput, self, and target meet the . are supported. The can be ND. The shape supports zero to eight dimensions.

      • [object Object]Atlas inference series products[object Object] and [object Object]Atlas training series products[object Object]: The data type can be FLOAT16 or FLOAT.
      • [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 FLOAT.
    • target (aclTensor*, compute input): input [object Object] in the formula, aclTensor on the device. The data types of gradOutput, self, and target are the same. The shapes of gradOutput, self, and target meet the . are supported. The can be ND. The shape supports zero to eight dimensions.

      • [object Object]Atlas inference series products[object Object] and [object Object]Atlas training series products[object Object]: The data type can be FLOAT16 or FLOAT.
      • [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 FLOAT.
    • reduction (int64_t, compute input): [object Object] in the formula, which specifies the calculation method of the loss function. 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 self; sum indicates that the output will be summed.

    • out (aclTensor*, compute output): output [object Object] in the formula, aclTensor on the device. The shape is the same as that after broadcasting is performed for gradOutput, self, and target. are supported. The can be ND.

      • [object Object]Atlas inference series products[object Object] and [object Object]Atlas training series products[object Object]: The data type can be FLOAT16 or FLOAT.
      • [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 FLOAT.
    • 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 aclnnMseLossBackwardGetWorkspaceSize.

    • 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:
    • aclnnMseLossBackward defaults to a deterministic implementation.
[object Object]

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

[object Object]