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

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

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

# chunk

[common]\
fun [chunk](chunk.md)(input: [Tensor](../Tensor/index.md), numChunks: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) = 0): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;

`chunk(input: Tensor, numChunks: Long, dim: Long = 0L)`: the `chunk` operator. Split along `dim` into `num_chunks` near-equal parts (the last may be shorter). Returns VIEWS sharing the source's storage (one call, no copy); prefer it over repeated `narrow`s.