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

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

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

# copyInto

[common]\
fun [copyInto](copyInto.md)(self: [Tensor](../Tensor/index.md), src: [Tensor](../Tensor/index.md), target: [Placement](../Placement/index.md)? = null): [Tensor](../Tensor/index.md)

`copyInto(self: Tensor, src: Tensor, target: Placement? = null)`: the `copy_into` operator. Write `src` into the caller-supplied `out` buffer (the destination-first spelling of the in-place copy; bind a persistent buffer once, write it every step with no allocation). Dtype conversion is interleaved with the write; a cross-device `src` is transferred first. Returns `out`. Writes through `self` and returns it, so calls chain.