quantile(input: Tensor, q: float | Sequence[float] | Tensor, dim: int | None = None, keepdim: bool = False, interpolation: str = 'linear')Compute the q-th quantile of input.
Parameters
inputTensorReal-valued input.
qfloat, sequence of float, or TensorQuantile(s) in . A single
q returns a tensor
without the leading quantile axis; a sequence/tensor adds a
leading axis of length len(q).dimint= NoneAxis along which to reduce.
None (default) reduces over
the flattened input.keepdimbool= FalseRetain the reduced axis as a size-1 dimension. Default
False.interpolationstr= 'linear'Rule for interpolating between the two samples bracketing the
quantile. One of
'linear' (default), 'lower',
'higher', 'midpoint', 'nearest'.Returns
TensorSame dtype as input. Shape depends on q / dim /
keepdim.
See Also
nanquantile—NaN-aware sibling.