l1_loss

dragon.vm.torch.nn.functional.l1_loss(
  input,
  target,
  size_average=None,
  reduce=None,
  reduction='mean'
)[source]

Compute the element-wise absolute value difference.

The L1Loss function is defined as:

\[\text{L1Loss}(x, y) = |x - y| \]
Parameters:
  • input (dragon.vm.torch.Tensor) – The input tensor.
  • target (dragon.vm.torch.Tensor) – The target tensor.
  • size_average (bool, optional) – Whether to average the loss.
  • reduce (bool, optional) – Whether to reduce the loss.
  • reduction ({'none', 'mean', 'sum'}, optional) – The reduce method.
Returns:

dragon.vm.torch.Tensor – The output tensor.