Update docs for quantile to be clearer for nearest (#162423)

Correct the rounding scheme for nearest in quantile.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/162423
Approved by: https://github.com/soulitzer
This commit is contained in:
Jane Xu
2025-09-09 18:04:09 +00:00
committed by PyTorch MergeBot
parent e1be887870
commit 0ec723acd0

View File

@ -7132,7 +7132,7 @@ indices ``i`` and ``j`` in the sorted order, result is computed according to the
- ``linear``: ``a + (b - a) * fraction``, where ``fraction`` is the fractional part of the computed quantile index.
- ``lower``: ``a``.
- ``higher``: ``b``.
- ``nearest``: ``a`` or ``b``, whichever's index is closer to the computed quantile index (rounding down for .5 fractions).
- ``nearest``: ``a`` or ``b``, whichever's index is closer to the computed quantile index (follows :func:`torch.round`).
- ``midpoint``: ``(a + b) / 2``.
If :attr:`q` is a 1D tensor, the first dimension of the output represents the quantiles and has size