---
title: "ClikaRT::ops::reshape"
sidebar_label: "reshape"
description: "Reshape to shape; one entry may be -1 to infer it from the element count. A dim entry is an int literal OR a 0-D/1-D integer Tensor (IndexBound); e.g."
---

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

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

## reshape() {#reshape}

<div class="api-signature">

[`Tensor`](../Tensor.md) **`reshape`**([`Tensor`](../Tensor.md) `input`, [`ClikaRT::Span`](../Span.md)`<const` [`IndexBound`](./IndexBound.md)`>` `shape`)

</div>

Reshape to [`shape`](./shape.md#shape); one entry may be -1 to infer it from the element count. A dim entry is an int literal OR a 0-D/1-D integer [Tensor](../Tensor.md) ([`IndexBound`](./IndexBound.md)); e.g. [`reshape`](./reshape.md#reshape)`(x, {shape_host(x, 1), d})` composes without reading sizes to the host.

<div class="api-declared">

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

</div>
