---
title: "ClikaRT::nn::SmoothL1Loss"
sidebar_label: "SmoothL1Loss"
description: "Squared error below beta, absolute error above it, between input and target."
---

<!-- 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)

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

## Member functions

### SmoothL1Loss() {#SmoothL1Loss}

<div class="api-signature">

`explicit` **`SmoothL1Loss`**([`SmoothL1LossOptions`](./SmoothL1LossOptions.md) `options` `=` `{}`)

</div>

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

<div class="api-declared">

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

</div>

### forward() {#forward}

<div class="api-signature">

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

</div>

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

<div class="api-declared">

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

</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`](./SmoothL1Loss.md#forward).

<div class="api-declared">

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

</div>

### options() {#options}

<div class="api-signature">

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

</div>

The settings this module was constructed with.

<div class="api-declared">

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

</div>
