Skip to content

Commit

Permalink
Ignore bad return type annotation in convert_seed_and_sample_shape
Browse files Browse the repository at this point in the history
Why? This annotation 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` has been effectively considered to be `Any`; this incorrect annotation is blocking us from making `chex.PRNGKey` a more meaningful annotation.

PiperOrigin-RevId: 565142299
  • Loading branch information
Jake VanderPlas authored and DistraxDev committed Sep 13, 2023
1 parent 079849a commit c19b7c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion distrax/_src/distributions/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit c19b7c9

Please sign in to comment.