---
title: "ClikaRT::ops::nanmean"
sidebar_label: "nanmean"
description: "Mean over dims, treating NaN entries as missing. Each output element divides by the count of NON-NaN contributors (an all-NaN slice yields NaN). Float dtypes only."
---

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

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

## nanmean() {#nanmean}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`nanmean`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `input`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`ClikaRT::Span`](../Span.md)`<const std::int64_t>` `dims` `=` `{}`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`bool` `keepdim` `=` `false`<br />
)

</div>

Mean over `dims`, treating NaN entries as missing.

Each output element divides by the count of NON-NaN contributors (an all-NaN slice yields NaN). Float dtypes only.

**Parameters**

- `input`: the input tensor; float dtype.
- `dims`: axes to reduce; empty = all axes.
- `keepdim`: keep reduced axes as size-1 dims; default false.

**Returns:** the NaN-skipping mean; shape = `input` minus `dims`.

**Throws**

- `ClikaRT::Error`: (`INVALID_ARGUMENT`) on an out-of-range `dims` entry or a non-float input.

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 4423

</div>
