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

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

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

# put

[common]\
fun [put](put.md)(input: [Tensor](../Tensor/index.md), index: [Tensor](../Tensor/index.md), source: [Tensor](../Tensor/index.md), accumulate: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false): [Tensor](../Tensor/index.md)

`put(input: Tensor, index: Tensor, source: Tensor, accumulate: Boolean = false)`: the `put` operator. A copy of `input` with `source` written at FLAT (row-major linearized) positions: `out.flat[index[i]] = source.flat[i]`. With `accumulate = true` duplicate positions ADD instead of overwrite. `index` and `source` carry the same element count; index dtype law as `gather`.