Skip to content

Commit

Permalink
Fix inject_hyperparams() for python < 3.10.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 507791335
  • Loading branch information
hbq1 authored and OptaxDev committed Feb 7, 2023
1 parent 4919451 commit 6f70d28
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion optax/_src/schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import chex
import jax
import jax.numpy as jnp
import numpy as np

from optax._src import base
from optax._src import numerics
Expand Down Expand Up @@ -585,7 +586,7 @@ def wrapped_transform(*args, **kwargs) -> base.GradientTransformation:
other_hps[name] = value
elif callable(value):
sched_hps[name] = value
elif isinstance(value, (int, float, chex.Array)):
elif isinstance(value, (int, float, jax.Array, np.ndarray)):
numeric_hps[name] = value
else:
other_hps[name] = value
Expand Down

0 comments on commit 6f70d28

Please sign in to comment.