From e0d994d3b0559ab96fa4b0e76833867816683467 Mon Sep 17 00:00:00 2001 From: Jake VanderPlas Date: Wed, 13 Sep 2023 13:21:59 -0700 Subject: [PATCH] Ignore bad return type annotation in convert_seed_and_sample_shape Why? This type is incorrect (the type checker does not consider `rng` here to be a `PRNGKey`) The reason this has worked in the past is because `chex.PRNGKey` is considered to be `Any`; this incorrect annotation is blocking us from making `chex.PRNGKey` a more meaningful annotation. PiperOrigin-RevId: 565142299 --- distrax/_src/distributions/distribution.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distrax/_src/distributions/distribution.py b/distrax/_src/distributions/distribution.py index 0d60e9c..ec33f6d 100644 --- a/distrax/_src/distributions/distribution.py +++ b/distrax/_src/distributions/distribution.py @@ -324,7 +324,7 @@ def convert_seed_and_sample_shape( else: # key is of type PRNGKey rng = seed - return rng, sample_shape + return rng, sample_shape # type: ignore[bad-return-type] def to_batch_shape_index(