[object Object]

[object Object][object Object]undefined
[object Object]
  • This API is used to calculate the SmoothL1 loss function.

  • Formula:

    If [object Object] is [object Object], the loss function for batch N is defined as follows:

    (self,target)=L={l1,,lN}\ell(self,target) = L = \{l_1,\dots,l_N\}^\top

    lnl_n is calculated as follows:

    ln={0.5(selfntargetn)2/beta,ifselfntargetn<betaselfntargetn0.5beta,otherwisel_n = \begin{cases} 0.5(self_n-target_n)^2/beta, & if |self_n-target_n| < beta \\ |self_n-target_n| - 0.5*beta, & otherwise \end{cases}

    If [object Object] is [object Object] or [object Object]:

    (self,target)={mean(L),if reduction=meansum(L),if reduction=sum\ell(self,target)=\begin{cases} mean(L), & \text{if reduction} = \text{mean}\\ sum(L), & \text{if reduction} = \text{sum} \end{cases}
[object Object]

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

[object Object]
[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]
[object Object]
  • Parameters:

    [object Object]
  • Returns:

    [object Object]: status code. For details, see .

[object Object]
  • Deterministic compute:
    • aclnnSmoothL1Loss defaults to a deterministic implementation.
[object Object]

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

[object Object]