[object Object]

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

Computes logits of the input self, and performs backpropagation of the with respect to the target label value target.

[object Object]

Each operator has calls. First, aclnnBinaryCrossEntropyWithLogitsTargetBackwardGetWorkspaceSize is called to obtain the input parameters and compute the required workspace size based on the process. Then, aclnnBinaryCrossEntropyWithLogitsTargetBackward is called to perform computation.

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

    • gradOutput (aclTensor *, compute input): gradient value of the previous step of network backpropagation, which is an aclTensor on the device. The data type can be FLOAT16, FLOAT, or BFLOAT16. The shape must be able to be to the shape of self. are supported. The can be ND.
    • self (aclTensor *, compute input): computation result of the previous layer in the forward propagation of the network, which is an aclTensor on the device. The data type can be FLOAT16, FLOAT, or BFLOAT16. The shape is less than or equal to 8D. are supported. The can be ND.
    • target (aclTensor *, compute input): label value, which is an aclTensor on the device. The data type can be FLOAT, FLOAT16, or BFLOAT16. The shape must be the same as that of self, and must be less than or equal to 8D. are supported. The can be ND.
    • weightOptional (aclTensor *, compute input): weight of binary cross entropy, which is an aclTensor on the device. The data type can be FLOAT16, FLOAT, or BFLOAT16. The shape must be able to be to the shape of self. are supported. The supports ND. If weightOptional is empty, a tensor filled with 1s is created based on the shape of self.
    • posWeightOptional (aclTensor *, compute input): weight of the positive class, which is an aclTensor on the device. The data type can be FLOAT16, FLOAT, or BFLOAT16. The shape can be to the shape of self. are supported. The supports ND. If weightOptional is empty, a tensor filled with 1s is created based on the shape of self.
    • reduction (int64_t, compute input): reduction operation performed on the gradient computation result of binary cross entropy. It is an integer on the host. The data type can be INT64. Only 0, 1, and 2 are supported. 0 indicates that no operation is performed. 1 indicates that the average value of the results is used. 2 indicates that the results are summed up.
    • gradTarget (aclTensor*, compute output): gradient computation result, which is an aclTensor on the device. The data type can be FLOAT, FLOAT16, or BFLOAT16. The data type must be the same as that of target. The shape must be the same as that of self, and must be less than or equal to 8D. are supported. The can be ND and must be the same as that of self.
    • 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 calling the first-phase API aclnnBinaryCrossEntropyWithLogitsTargetBackwardGetWorkspaceSize.
    • 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:
    • aclnnBinaryCrossEntropyWithLogitsTargetBackward defaults to a deterministic implementation.
[object Object]

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

[object Object]