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

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

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

# unflatten

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

`unflatten(input: Tensor, dim: Long, sizes: LongArray)`: the `unflatten` operator. Split the dim at `dim` into `sizes`, the inverse of `flatten`. The product of `sizes` must equal that dim's extent. Returns a view sharing storage when the layout permits; copies otherwise.