Skip to content

WIP: top_k draft implementation #26666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix lint errors
  • Loading branch information
JuliaPoo committed Jun 12, 2024
commit d724d211f8ee85b392bfe9f536d8269aabba173d
8 changes: 4 additions & 4 deletions numpy/_core/tests/test_multiarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -3177,11 +3177,11 @@ def test_argpartition_gh5524(self, kth_dtype):
self.assert_partitioned(np.array(d)[p],[1])

def assert_top_k(self, a, axis: int, x, y):
x_value, x_indices = x
y_value, y_indices = y
x_value, x_ind = x
y_value, y_ind = y
assert_equal(np.sort(x_value, axis=axis), np.sort(y_value, axis=axis))
assert_equal(np.sort(x_indices, axis=axis), np.sort(y_indices, axis=axis))
assert_equal(np.take_along_axis(a, x_indices, axis=axis), x_value)
assert_equal(np.sort(x_ind, axis=axis), np.sort(y_ind, axis=axis))
assert_equal(np.take_along_axis(a, x_ind, axis=axis), x_value)

def test_top_k(self):

Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy