Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

* Changed `dpnp.tensor.top_k` to select the `k` elements with a radix select instead of sorting every row, for all but complex data types. The order of the returned elements is now unspecified, where it was largest-first or smallest-first before [#3079](https://github.com/IntelPython/dpnp/pull/3079)

### Deprecated

* Deprecated `dpnp.dot` and `dpnp.ndarray.dot` when `a.ndim >= 2` and `b.ndim > 2`, which place the leading dimensions of `b` in the middle of the result; use `dpnp.tensordot(a, b, axes=(-1, -2))` or `dpnp.matmul` instead [#3124](https://github.com/IntelPython/dpnp/pull/3124)
Expand Down
5 changes: 5 additions & 0 deletions dpnp/tensor/_sorting.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,11 @@ def top_k(x, k, /, *, axis=None, mode="largest"):
* second element `indices` will be an array containing indices of
`x` that result in `values`. The array will have the same shape
as `values` and will have the default array index data type.

.. note::
The order of the `k` elements along `axis` in `values` and `indices`
is unspecified, and may depend on the data type, the shape of `x` and
the device. Sort the result if a particular order is needed.
"""
largest = _get_top_k_largest(mode)
if not isinstance(x, dpt.usm_ndarray):
Expand Down
Loading
Loading