Jules
Jules
Since the original comment is almost a year ago, I thought I'd do another run. I've tried to organise the UBs according to the file it came from. The full...
Could you send the command that led to that output, and the output of the command `pip list`?
The issue seems to be that you're using a python version that's incompatible with `tflite-runtime` (which has to be Python 3.7, 3.8 or 3.9). I had previously expected google to...
Oh huh that's annoying, tflite-runtime has missing binaries just whatever. I'll fix this when I have more free time but for now you can use python 3.8 which I know...
I've drafted a PR to `array-api-compat`: data-apis/array-api-compat#158 that informs us about how compatible numpy's `top_k` implementation is to other existing implementations. Notably, it is directly compatible with `torch.topk`. Are there...
With #26716 merged, I've updated the docstring for `top_k` about the sort order of complex and nans, and added a release note.
Continuing from the discussion [here](https://github.com/numpy/numpy/issues/15128#issuecomment-2207001141), I've special-cased types in `np.typecodes["AllFloat"]` (`float16, float32, float64, float64, complex64, complex128, complex128`) to push `np.nan`s to the back. I.e., `np.top_k(np.array([1,2,3,np.nan], dtype="f"), 3)` will return values...
I personally found it a little weird to be sorting complex. Now that you mentioned it, I'm leaning towards `np.top_k` defaulting to `np.sort` ordering for complex.
I'm linking the discussion on array-api for `top_k` and related functions at data-apis/array-api#722, and the discussions on the [mailing list](https://mail.python.org/archives/list/[email protected]/thread/F4P5UVTAKRJJ3OORI6UOWFSUEE5CNTSC/). It seems that the consensus for such a function could...
I'm personally fine with considering `np.nan` as the largest element, mostly because it follows the sort order in other numpy apis like `np.sort/np.argsort` and `np.partition/np.argpartition`, and users might reasonably expect...