Improve error message when user mistakenly holds a jax Array in an nnx.Module
Open
- Dominant language
- Jupyter Notebook
- Stars
- 7.3k
- Forks
- 833
- Avg merge
- 5h 11m
- Merged PRs (30d)
- 5
Description
The [line here](https://github.com/google/flax/blob/1961c1259e6c2d22a0c27de9599476aaa073a553/flax/nnx/graph.py#L449) raises, imo, a vague error message (at least I felt so as a beginner to Jax, Flax and nnx).
I was holding a jax Array (a random key) in an nnx.Module and that led to the error. tbh, I am not sure if this happens only in this case. Either way, I would be happy to help improve the error message if it helps.
Contributor guide
Assessment
This issue has not been assessed yet.