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

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

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

# copyInPlace

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

`copyInPlace(self: Tensor, src: Tensor, target: Placement? = null)`: the `copy_` operator. Copies `src` INTO `self`'s existing storage, converting per element to `self`'s dtype in the same single pass (never `cast` first; the copy IS the cast). Shapes must match after broadcasting `src`. Raises `ClikaRT::Error` where the shapes/dtypes cannot be served; returns `self` under the value surface, `Result<void>` under the `Result` surface; `CLIKART_CHECK` is the mode-stable spelling. Writes through `self` and returns it, so calls chain.