---
title: "ClikaRT::ops::copy_to_cpu"
sidebar_label: "copy_to_cpu"
description: "Materializes a host-resident copy of the tensor (device-to-host transfer; an owning CPU tensor even when src is already on the CPU)."
---

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

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

## copy\_to\_cpu() {#copy_to_cpu}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`copy_to_cpu`**([`Tensor`](../Tensor.md) `src`)

</div>

Materializes a host-resident copy of the tensor (device-to-host transfer; an owning CPU tensor even when `src` is already on the CPU).

**Throws**

- `ClikaRT::Error`: when the input's dtype/shape is not served for this operation (the machine-readable reason rides `code_name()`).

**Returns:** the CPU-resident copy.

<div class="api-declared">

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

</div>
