Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't swallow errors with RNG keys in parameter initialisers.
Given the following code snippet: ```python def f(x): x = hk.Conv2D(3, 1)(x) return x f = hk.transform(f) x = jnp.ones([1, 28, 28]) f.init(None, x) ``` At HEAD we fail with a confusing error: ValueError: Parameters cannot be `None`. After this change we fail with a far more useful: MissingRNGError: You must pass a non-None PRNGKey to init and/or apply if you make use of random numbers. PiperOrigin-RevId: 551256122
- Loading branch information