This API is used to calculate the negative log likelihood loss.
Formula:
If
[object Object]is[object Object]:indicates self, indicates target, indicates weight, and indicates the batch size. If
[object Object]is not[object Object]:
Each operator has calls. First, aclnnNLLLoss2dGetWorkspaceSize is called to obtain the workspace size required for computation and the executor that contains the operator computation process. Then, aclnnNLLLoss2d is called to perform computation.
[object Object]
[object Object]
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]
- Deterministic compute:
- aclnnNLLLoss2d defaults to a non-deterministic implementation. You can call aclrtCtxSetSysParamOpt to enable deterministic compute.
The following example is for reference only. For details, see .
[object Object]