Hi all,
Finding topk elements is widely used in several fields, but missed in NumPy.
I implement this functionality named asĀ numpy.topk using core numpy
functions and open a PR:
Any discussion are welcome.
Thanks for the proposal Kang. I think this functionality is indeed a fairly obvious gap in what Numpy offers, and would make sense to add. A detailed comparison with other libraries would be very helpful here. TensorFlow and JAX call this function `top_k`, while PyTorch, Dask and MXNet call it `topk`.