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

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

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

# maxPoolWithIndices

[common]\
fun [maxPoolWithIndices](maxPoolWithIndices.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)): [List](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html)&lt;[Tensor](../Tensor/index.md)&gt;

`maxPoolWithIndices(input: Tensor, kernelSize: LongArray, stride: LongArray, padding: LongArray, dilation: LongArray, ceilMode: Boolean)`: the `max_pool_with_indices` operator. Max pooling that also returns each window's winning element as a flat index over the input's spatial extents (per plane, the same for every channel). The values follow `max_pool`. The index names the window's lowest-index NaN element when it holds one, else the first element holding the max (a tie keeps the lowest index); a window lying wholly in the padding reports -1.