---
title: "ClikaRT::nn::Upsample"
sidebar_label: "Upsample"
description: "Resamples the spatial dimensions to size or by scale_factor (exactly one given); the input is channels-last and its rank picks the spatial variant."
---

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

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

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

Resamples the spatial dimensions to `size` or by `scale_factor` (exactly one given); the input is channels-last and its rank picks the spatial variant. The two settings share one type, so the module is constructed from its options: [`Upsample`](./Upsample.md)`(UpsampleOptions().scale_factor({2, 2}))`. The module form of [`ClikaRT::ops::interpolate`](../ops/interpolate.md#interpolate), which documents the full contract (shapes, dtypes, errors); construct once, then call it like a function.

## Member functions

### Upsample() {#Upsample}

<div class="api-signature">

`explicit` **`Upsample`**([`UpsampleOptions`](./UpsampleOptions.md) `options` `=` `{}`)

</div>

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

<div class="api-declared">

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

</div>

### forward() {#forward}

<div class="api-signature">

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

</div>

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

<div class="api-declared">

Declared in `ClikaRT/nn/generated/upsampling.h`, line 124

</div>

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

<div class="api-signature">

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

</div>

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

<div class="api-declared">

Declared in `ClikaRT/nn/generated/upsampling.h`, line 128

</div>

### options() {#options}

<div class="api-signature">

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

</div>

The settings this module was constructed with.

<div class="api-declared">

Declared in `ClikaRT/nn/generated/upsampling.h`, line 132

</div>
