---
title: "fillDiagonalInPlace"
sidebar_label: "fillDiagonalInPlace"
description: "Kotlin binding reference: fillDiagonalInPlace."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[Ops](index.md)/[fillDiagonalInPlace](fillDiagonalInPlace.md)

# fillDiagonalInPlace

[common]\
fun [fillDiagonalInPlace](fillDiagonalInPlace.md)(self: [Tensor](../Tensor/index.md), fillValue: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), wrap: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, device: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)

`fillDiagonalInPlace(self: Tensor, fillValue: Double, wrap: Boolean = false, device: Placement? = null)`: the `fill_diagonal_` operator. 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. Returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain.