---
title: "ClikaRT::nn::L1Loss"
sidebar_label: "L1Loss"
description: "Mean absolute error between input and target. The module form of ClikaRT::ops::l1_loss, which documents the full contract (shapes, dtypes, errors); construct once, then call it like a function."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--class">class</span>

**Header:** `ClikaRT/nn/generated/loss.h`  
**Inherits:** [`ClikaRT::nn::Module`](./Module.md)

Mean absolute error between `input` and `target`. The module form of [`ClikaRT::ops::l1_loss`](../ops/l1_loss.md#l1_loss), which documents the full contract (shapes, dtypes, errors); construct once, then call it like a function.

## Member functions

### L1Loss() {#L1Loss}

<div class="api-signature">

`explicit` **`L1Loss`**([`L1LossOptions`](./L1LossOptions.md) `options` `=` `{}`)

</div>

Constructs the module from [`options`](./L1Loss.md#options) (every default when omitted).

<div class="api-declared">

Declared in `ClikaRT/nn/generated/loss.h`, line 97

</div>

### forward() {#forward}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`forward`**([`Tensor`](../Tensor.md) `input`, [`Tensor`](../Tensor.md) `target`) `const`

</div>

[`forward_impl`](./L1Loss.md#forward), unwrapped: raises [`ClikaRT::Error`](../Error.md) on failure.

<div class="api-declared">

Declared in `ClikaRT/nn/generated/loss.h`, line 109

</div>

### operator()() {#operator-call}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`operator()`**([`Tensor`](../Tensor.md) `input`, [`Tensor`](../Tensor.md) `target`) `const`

</div>

Same as [`forward`](./L1Loss.md#forward).

<div class="api-declared">

Declared in `ClikaRT/nn/generated/loss.h`, line 113

</div>

### options() {#options}

<div class="api-signature">

`const` [`L1LossOptions`](./L1LossOptions.md)`&` **`options`**() `const`

</div>

The settings this module was constructed with.

<div class="api-declared">

Declared in `ClikaRT/nn/generated/loss.h`, line 117

</div>
