---
title: "ClikaRT::nn::BCEWithLogitsLoss"
sidebar_label: "BCEWithLogitsLoss"
description: "Binary cross entropy over logits: the sigmoid fused with the loss in one stable pass."
---

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

Binary cross entropy over logits: the sigmoid fused with the loss in one stable pass. The module form of [`ClikaRT::ops::binary_cross_entropy_with_logits`](../ops/binary_cross_entropy_with_logits.md#binary_cross_entropy_with_logits), which documents the full contract (shapes, dtypes, errors); construct once, then call it like a function.

## Member functions

### BCEWithLogitsLoss() {#BCEWithLogitsLoss}

<div class="api-signature">

`explicit` **`BCEWithLogitsLoss`**([`BCEWithLogitsLossOptions`](./BCEWithLogitsLossOptions.md) `options` `=` `{}`)

</div>

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

<div class="api-declared">

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

</div>

### forward() {#forward}

<div class="api-signature">

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

</div>

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

<div class="api-declared">

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

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

<div class="api-declared">

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

</div>

### options() {#options}

<div class="api-signature">

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

</div>

The settings this module was constructed with.

<div class="api-declared">

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

</div>
