Skip to content

Conversation

@ev-br
Copy link
Member

@ev-br ev-br commented Nov 17, 2025

  1. draw x1 array of a real dtype, not only default_float
  2. test side="left", "right"
  3. draw x2 of ndim > 1

@ev-br
Copy link
Member Author

ev-br commented Nov 17, 2025

The dtype test fails on jax. The issue is that the returned array must have the default array index data type, but with jax.numpy the result is always int32 even when JAX_ENABLE_X64=1 which makes the default indexing dtype int64:

$ JAX_ENABLE_X64=1 ipython
Python 3.11.0 | packaged by conda-forge | (main, Jan 14 2023, 12:27:40) [GCC 11.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.32.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import jax.numpy as jnp

In [2]: jnp.__array_namespace_info__().default_dtypes()
Out[2]: 
{'real floating': dtype('float64'),
 'complex floating': dtype('complex128'),
 'integral': dtype('int64'),
 'indexing': dtype('int64')}

In [3]: jnp.searchsorted(jnp.asarray([0], dtype=jnp.uint8), jnp.asarray([0], dtype=jnp.uint8), sorter=Non
   ...: e)
WARNING:2025-11-17 13:15:20,816:jax._src.xla_bridge:791: An NVIDIA GPU may be present on this machine, but a CUDA-enabled jaxlib is not installed. Falling back to cpu.
Out[3]: Array([0], dtype=int32)

Thoughts @jakevdp ?

EDIT: Oh I see, it's the same on main/master. So likely a known (minor) incompatibility with the spec.

@ev-br ev-br force-pushed the searchsorted_todos branch from ce479f6 to 5bd524b Compare November 17, 2025 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant