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

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

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

# indexFill

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

`indexFill(input: Tensor, dim: Long, indices: Tensor, value: Tensor)`: the `index_fill` operator. A copy of `input` with the rows at `indices` along `dim` set to `value`: `out[.., indices[i], ..] = value`. `indices` is 1-D `Int32`/`Int64`; `value` is a literal or a 0-D Tensor.

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

`indexFill(input: Tensor, dim: Long, indices: Tensor, value: Double)`: the number form of `index_fill`, `value` as a scalar.