---
title: "ClikaRT::nn::BCEWithLogitsLossOptions"
sidebar_label: "BCEWithLogitsLossOptions"
description: "Settings of BCEWithLogitsLoss: chain the setters, or assign the fields."
---

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

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

**Header:** `ClikaRT/nn/generated/loss.h`

Settings of [`BCEWithLogitsLoss`](./BCEWithLogitsLoss.md): chain the setters, or assign the fields.

## Member functions

### weight(OptionalTensor) {#weight}

<div class="api-signature">

[`BCEWithLogitsLossOptions`](./BCEWithLogitsLossOptions.md)`&` **`weight`**([`OptionalTensor`](../../index.md#OptionalTensor) `v`)

</div>

Sets [`weight`](./BCEWithLogitsLossOptions.md#weight), a per-element rescaling weight, broadcast against `input`; unset weighs 1.

<div class="api-declared">

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

</div>

### weight() {#weight-2}

<div class="api-signature">

`const` [`OptionalTensor`](../../index.md#OptionalTensor)`&` **`weight`**() `const`

</div>

Reads [`weight`](./BCEWithLogitsLossOptions.md#weight).

<div class="api-declared">

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

</div>

### reduction(ops::Reduction) {#reduction}

<div class="api-signature">

[`BCEWithLogitsLossOptions`](./BCEWithLogitsLossOptions.md)`&` **`reduction`**([`ops::Reduction`](../ops/index.md#Reduction) `v`)

</div>

Sets [`reduction`](./BCEWithLogitsLossOptions.md#reduction), how the elementwise losses reduce.

<div class="api-declared">

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

</div>

### reduction() {#reduction-2}

<div class="api-signature">

[`ops::Reduction`](../ops/index.md#Reduction) **`reduction`**() `const`

</div>

Reads [`reduction`](./BCEWithLogitsLossOptions.md#reduction).

<div class="api-declared">

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

</div>

### pos\_weight(OptionalTensor) {#pos_weight}

<div class="api-signature">

[`BCEWithLogitsLossOptions`](./BCEWithLogitsLossOptions.md)`&` **`pos_weight`**([`OptionalTensor`](../../index.md#OptionalTensor) `v`)

</div>

Sets [`pos_weight`](./BCEWithLogitsLossOptions.md#pos_weight), a weight on the positive class, broadcast against `input`; unset weighs 1.

<div class="api-declared">

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

</div>

### pos\_weight() {#pos_weight-2}

<div class="api-signature">

`const` [`OptionalTensor`](../../index.md#OptionalTensor)`&` **`pos_weight`**() `const`

</div>

Reads [`pos_weight`](./BCEWithLogitsLossOptions.md#pos_weight).

<div class="api-declared">

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

</div>

## Data members

### weight\_ {#weight_}

<div class="api-signature">

[`OptionalTensor`](../../index.md#OptionalTensor) **`weight_`** `= {}`

</div>

A per-element rescaling weight, broadcast against `input`; unset weighs 1. Default `{}`.

<div class="api-declared">

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

</div>

### reduction\_ {#reduction_}

<div class="api-signature">

[`ops::Reduction`](../ops/index.md#Reduction) **`reduction_`** `=` [`ops::Reduction::Mean`](../ops/index.md#Reduction)

</div>

How the elementwise losses reduce. Default [`ops::Reduction::Mean`](../ops/index.md#Reduction).

<div class="api-declared">

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

</div>

### pos\_weight\_ {#pos_weight_}

<div class="api-signature">

[`OptionalTensor`](../../index.md#OptionalTensor) **`pos_weight_`** `= {}`

</div>

A weight on the positive class, broadcast against `input`; unset weighs 1. Default `{}`.

<div class="api-declared">

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

</div>
