Skip to content
Discussion options

You must be logged in to vote

Hi, thanks for the question! This is expected behavior. Pythons and operator requires concrete boolean arguments, and thus is incompatible with traced values within JAX transforms, in which the inputs are not concrete. Moreover, unlike the & operator, which can be overloaded via the __and__ method, Python offers no way to directly overload the behavior of its and operator. For these reasons, there is no way for JAX (and other array libraries like numpy) to dispatch element-wise array operations using Python's and. The alternative, which you've already discovered, is to use &.

For more information on JAX transforms, tracers, and concrete values, see https://jax.readthedocs.io/en/latest/not…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ASEM000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants