---
title: "ClikaRT::ops::std"
sidebar_label: "std"
description: "Standard deviation of input over dims, with Bessel correction."
---

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

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

## std() {#std}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`std`**(<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;`int64_t` `correction` `=` `1`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`bool` `keepdim` `=` `false`<br />
)

</div>

Standard deviation of `input` over `dims`, with Bessel correction.

$$
\mathrm{out} = \sqrt{\tfrac{1}{n - c}\sum_{i}\,(x_i - \bar{x})^2}
$$

`correction` is the `c` above: 1 (the default) gives the sample standard deviation, 0 the population form.

**Parameters**

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

**Returns:** the standard deviations; shape = `input` minus `dims`.

**Throws**

- `ClikaRT::Error`: (`INVALID_ARGUMENT`) on an out-of-range `dims` entry.

<div class="api-declared">

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

</div>
