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

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

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

# maxPool

[common]\
fun [maxPool](maxPool.md)(input: [Tensor](../Tensor/index.md), kernelSize: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), stride: [LongArray](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long-array/index.html), padding: [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), ceilMode: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)): [Tensor](../Tensor/index.md)

`maxPool(input: Tensor, kernelSize: LongArray, stride: LongArray, padding: LongArray, dilation: LongArray, ceilMode: Boolean)`: the `max_pool` operator. Rank-generic max pooling, channels-last. `input` is `[N, D1..Dn, C]`; the window rank is read from `kernel_size`'s length. Each output element is the maximum over its window; padding never wins. A window holding any NaN element yields NaN, and a window lying wholly in the padding yields -inf for a float dtype and the type minimum for an integer one.