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

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

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

# scatterInPlace

[common]\
fun [scatterInPlace](scatterInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md)): [Tensor](../Tensor/index.md)

`scatterInPlace(self: Tensor, dim: Long, index: Tensor, src: Tensor)`: the `scatter_` operator. In-place `scatter`: writes through `self` at the indexed positions; same arguments and error conditions as `scatter()`. Writes through `self`'s storage (a strided view reaches its base buffer). Returns `self` for chaining. Writes through `self` and returns it, so calls chain.

[common]\
fun [scatterInPlace](scatterInPlace.md)(self: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), index: [Tensor](../Tensor/index.md), src: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)): [Tensor](../Tensor/index.md)

`scatterInPlace(self: Tensor, dim: Long, index: Tensor, src: Double)`: the number form of `scatter_`, `src` as a scalar.