File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -4577,6 +4577,12 @@ def merge_dicts(*dicts):
45774577
45784578Returns the median value of all elements in the :attr:`input` tensor.
45794579
4580+ .. note::
4581+ The median is not unique for :attr:`input` tensors with an even number
4582+ of elements. In this case the lower of the two medians is returned. To
4583+ compute the mean of both medians in :attr:`input`, use :func:`torch.quantile`
4584+ with ``q=0.5`` instead.
4585+
45804586.. warning::
45814587 This function produces deterministic (sub)gradients unlike ``median(dim=0)``
45824588
@@ -4604,6 +4610,12 @@ def merge_dicts(*dicts):
46044610Otherwise, :attr:`dim` is squeezed (see :func:`torch.squeeze`), resulting in
46054611the outputs tensor having 1 fewer dimension than :attr:`input`.
46064612
4613+ .. note::
4614+ The median is not unique for :attr:`input` tensors with an even number
4615+ of elements in the dimension :attr:`dim`. In this case the lower of the
4616+ two medians is returned. To compute the mean of both medians in
4617+ :attr:`input`, use :func:`torch.quantile` with ``q=0.5`` instead.
4618+
46074619.. warning::
46084620 ``indices`` does not necessarily contain the first occurrence of each
46094621 median value found, unless it is unique.
You can’t perform that action at this time.
0 commit comments