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

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

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

# indexCopy

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

`indexCopy(input: Tensor, dim: Long, indices: Tensor, src: Tensor)`: the `index_copy` operator. A copy of `input` with rows of `src` WRITTEN at `indices` along `dim`: `out[.., indices[i], ..] = src[.., i, ..]`. Prefer unique indices; a duplicated position is written more than once. Same shape/index-dtype rules as `index_add`.