- Description: Computes the backward pass of aclnnCrossEntropyLoss.
- Formula: Non-zloss scenario: zloss scenario: With zloss enabled, the output gradient is accumulated:
Each operator has calls. First, aclnnCrossEntropyLossGradGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation flow. Then, aclnnCrossEntropyLossGrad is called to perform computation.
Parameters
[object Object]Returns
[object Object]: status code. For details, see .The first-phase API implements input parameter verification. The following errors may be thrown.
[object Object]
target only supports class label indices; probabilistic inputs are not supported.
The data types of gradLoss, logProb, gradZlossOptional, lseForZlossOptional, and xGradOut must be the same.
The zloss-related features are currently not supported. Parameters gradZlossOptional, lseForZlossOptional, and lseSquareScaleForZloss are ignored even if provided.
Deterministic computation:
- aclnnCrossEntropyLossGrad defaults to a deterministic implementation.
The following example is for reference only. For details, see .