---
title: "ClikaRT::ops::fill_diagonal_"
sidebar_label: "fill_diagonal_"
description: "In-place fill_diagonal: writes the diagonal through self; same arguments and error conditions as fill_diagonal(). A view input writes through its base storage."
---

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

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

## fill\_diagonal\_() {#fill_diagonal_}

<div class="api-signature">

[`Tensor`](../Tensor.md)`&` **`fill_diagonal_`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md)`&` `self`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Scalar`](../Scalar.md) `fill_value`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;`bool` `wrap` `=` `false`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`StreamOrDevice`](../StreamOrDevice.md) `device` `=` `{}`<br />
)

</div>

In-place [`fill_diagonal`](./fill_diagonal.md#fill_diagonal): writes the diagonal through `self`; same arguments and error conditions as [`fill_diagonal()`](./fill_diagonal.md#fill_diagonal). A view input writes through its base storage. Returns `self` under the value surface, [`Result`](../Result.md)`<void>` under the [`Result`](../Result.md) surface; [`CLIKART_CHECK`](../../index.md#CLIKART_CHECK) is the mode-stable spelling.

<div class="api-declared">

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

</div>
