This interface is used to construct a callable object of the
L1Lossclass. The L1Loss layer calculates the L1 Loss of input predictions and target labels as follows.
'none', the unreduced loss is: .. math:
Out = |input - label|
'mean', the reduced mean loss is: .. math:
Out = MEAN(|input - label|)
'sum', the reduced sum loss is: .. math:
Out = SUM(|input - label|)
The shape of input predictions and target labels are [N, *], where N is batch_size and * means any number of additional dimensions. If
'none', the shape of output loss is [N, *], the same as input. If
'sum', the shape of output loss is , which means the output is a scalar.
reduction (str, optional) – Indicate the reduction to apply to the loss, the candicates are
'none', the unreduced loss is returned; If
'mean', the reduced mean loss is returned. If
'sum', the reduced sum loss is returned. Default is
A callable object of L1Loss.
Defines the computation performed at every call. Should be overridden by all subclasses.
*inputs (tuple) – unpacked tuple arguments
**kwargs (dict) – unpacked dict arguments