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

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

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

# copy

[common]\
fun [copy](copy.md)(src: [Tensor](../Tensor/index.md), target: [Placement](../Placement/index.md)? = null, forceCopy: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = true): [Tensor](../Tensor/index.md)

`copy(src: Tensor, target: Placement? = null, forceCopy: Boolean = true)`: the `copy` operator. Copies a tensor, optionally to another device or stream. With the default `force_copy = true` the result always owns fresh storage; with `force_copy = false` a same-device copy may pass the input through. `target` absent = `src`'s own stream.