jax
jax copied to clipboard
improve IndexError error message from abstracted values
This message could be improved to point to the specific reason (jit, pmap, fori_loop, etc) and user source line which caused the problematic tracing: "IndexError: Array slice indices must have static start/stop/step to be used with NumPy indexing syntax. To index a statically sized array at a dynamic position, try lax.dynamic_slice/dynamic_update_slice (JAX does not support dynamically sized arrays within JIT compiled functions)."
Hi @mattjj
It looks like the error message has been improved by including f"Found slice({i.start}, {i.stop}, {i.step}) "
in the error message by the PR #8124.
Please refer https://stackoverflow.com/questions/76611278/indexerror-array-slice-indices-must-have-static-start-stop-step-to-be-used-with to see the improved error message.
Thank you.
Thanks for checking! I think we should still improve this further though...