---
title: "ClikaRT::nn::Softmax"
sidebar_label: "Softmax"
description: "Softmax along dim, computed stably. The module form of ClikaRT::ops::softmax, 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/activation.h`  
**Inherits:** [`ClikaRT::nn::Module`](./Module.md)

[Softmax](./Softmax.md) along dim, computed stably. The module form of [`ClikaRT::ops::softmax`](../ops/softmax.md#softmax), which documents the full contract (shapes, dtypes, errors); construct once, then call it like a function.

## Member functions

### Softmax(SoftmaxOptions) {#Softmax}

<div class="api-signature">

`explicit` **`Softmax`**([`SoftmaxOptions`](./SoftmaxOptions.md) `options` `=` `{}`)

</div>

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

<div class="api-declared">

Declared in `ClikaRT/nn/generated/activation.h`, line 1241

</div>

### Softmax(int64\_t) {#Softmax-2}

<div class="api-signature">

`explicit` **`Softmax`**(`std::int64_t` `dim`)

</div>

`Softmax(dim)`: the positional form of `SoftmaxOptions(dim)`.

<div class="api-declared">

Declared in `ClikaRT/nn/generated/activation.h`, line 1243

</div>

### forward() {#forward}

<div class="api-signature">

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

</div>

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

<div class="api-declared">

Declared in `ClikaRT/nn/generated/activation.h`, line 1254

</div>

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

<div class="api-signature">

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

</div>

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

<div class="api-declared">

Declared in `ClikaRT/nn/generated/activation.h`, line 1258

</div>

### options() {#options}

<div class="api-signature">

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

</div>

The settings this module was constructed with.

<div class="api-declared">

Declared in `ClikaRT/nn/generated/activation.h`, line 1262

</div>
