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

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

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

# reshape

[common]\
fun [reshape](reshape.md)(input: [Tensor](../Tensor/index.md), shape: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html)): [Tensor](../Tensor/index.md)

`reshape(input: Tensor, shape: LongArray)`: the `reshape` operator. 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. `reshape(x, {shape_host(x, 1), d})` composes without reading sizes to the host.