---
title: "ClikaRT::ops::clone"
sidebar_label: "clone"
description: "Deep copy on the same device: fresh storage, identical shape, dtype, and values. Equivalent to copy(src) with the defaults."
---

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

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

## clone() {#clone}

<div class="api-signature">

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

</div>

Deep copy on the same device: fresh storage, identical shape, dtype, and values. Equivalent to `copy(src)` with the defaults.

**Throws**

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

**Returns:** the owning copy.

<div class="api-declared">

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

</div>
