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

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

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

# quantile

[common]\
fun [quantile](quantile.md)(input: [Tensor](../Tensor/index.md), q: [Tensor](../Tensor/index.md), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, interpolation: [QuantileInterp](../QuantileInterp/index.md) = QuantileInterp.LINEAR): [Tensor](../Tensor/index.md)

`quantile(input: Tensor, q: Tensor, dim: Long? = null, keepdim: Boolean = false, interpolation: QuantileInterp = QuantileInterp.LINEAR)`: the `quantile` operator. The `q`-th quantile of `input` along `dim`. `q` is a scalar or 1-D tensor of probabilities in `[0, 1]`. Absent `dim` flattens `input` first. The output prepends `q`'s shape to the reduced shape; `interpolation` picks the between-ranks strategy (`Linear` by default; see `QuantileInterp` for the full set).

[common]\
fun [quantile](quantile.md)(input: [Tensor](../Tensor/index.md), q: [Double](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-double/index.html), dim: [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)? = null, keepdim: [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) = false, interpolation: [QuantileInterp](../QuantileInterp/index.md) = QuantileInterp.LINEAR): [Tensor](../Tensor/index.md)

`quantile(input: Tensor, q: Double, dim: Long? = null, keepdim: Boolean = false, interpolation: QuantileInterp = QuantileInterp.LINEAR)`: the number form of `quantile`, `q` as a scalar.