---
title: "ClikaRT::nn::LogSoftmax"
sidebar_label: "LogSoftmax"
description: "Logarithm of the softmax along dim, computed stably in one pass."
---

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

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

## Member functions

### LogSoftmax(LogSoftmaxOptions) {#LogSoftmax}

<div class="api-signature">

`explicit` **`LogSoftmax`**([`LogSoftmaxOptions`](./LogSoftmaxOptions.md) `options` `=` `{}`)

</div>

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

<div class="api-declared">

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

</div>

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

<div class="api-signature">

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

</div>

`LogSoftmax(dim)`: the positional form of `LogSoftmaxOptions(dim)`.

<div class="api-declared">

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

</div>

### forward() {#forward}

<div class="api-signature">

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

</div>

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

<div class="api-declared">

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

</div>

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

<div class="api-signature">

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

</div>

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

<div class="api-declared">

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

</div>

### options() {#options}

<div class="api-signature">

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

</div>

The settings this module was constructed with.

<div class="api-declared">

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

</div>
