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

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

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

# unfold

[common]\
fun [unfold](unfold.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), dilation: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), padding: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html) = longArrayOf(), mode: [PadMode](../PadMode/index.md) = PadMode.CONSTANT, value: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html)? = null): [Tensor](../Tensor/index.md)

`unfold(input: Tensor, kernelSize: LongArray, dilation: LongArray = longArrayOf(), padding: LongArray = longArrayOf(), stride: LongArray = longArrayOf(), mode: PadMode = PadMode.CONSTANT, value: Double? = null)`: the `unfold` operator. im2col: extracts sliding kernel windows from a channels-last input. Input `[N, spatial.., C]` (1-D/2-D/3-D); output `[N, L, prod(kernel_size), C]` where `L` is the number of window placements; channels-last throughout (window samples sit next to channels).