---
title: "ClikaRT::ops::copy_"
sidebar_label: "copy_"
description: "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."
---

<!-- Generated by tools/doxygen2mdx from Doxygen XML. Do not edit. -->

<span class="api-kind api-kind--function">function</span>

## copy\_() {#copy_}

<div class="api-signature">

[`Tensor`](../Tensor.md)`&` **`copy_`**(<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md)`&` `self`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`Tensor`](../Tensor.md) `src`,<br />
&nbsp;&nbsp;&nbsp;&nbsp;[`StreamOrDevice`](../StreamOrDevice.md) `target` `=` `{}`<br />
)

</div>

Copies `src` INTO `self`'s existing storage, converting per element to `self`'s dtype in the same single pass (never [`cast`](./cast.md#cast) first; the copy IS the cast). Shapes must match after broadcasting `src`. Raises [`ClikaRT::Error`](../Error.md) where the shapes/dtypes cannot be served; returns `self` under the value surface, [`Result`](../Result.md)`<void>` under the [`Result`](../Result.md) surface; [`CLIKART_CHECK`](../../index.md#CLIKART_CHECK) is the mode-stable spelling.

<div class="api-declared">

Declared in `ClikaRT/compute/ops.h`, line 2079

</div>
