Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error with x64 loss #976

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Change hardcoded jnp.float32 to state.avg_value.dtype
  • Loading branch information
stefanocortinovis committed May 29, 2024
commit eaf00d607a78da0a702e132be2607fa0dfc3e578
2 changes: 1 addition & 1 deletion optax/contrib/_reduce_on_plateau.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def update_fn(
count = state.count
new_count = numerics.safe_int32_increment(count)
new_avg_value = (
count * state.avg_value + jnp.astype(value, jnp.float32)
count * state.avg_value + jnp.astype(value, state.avg_value.dtype)
) / new_count
new_state = state._replace(avg_value=new_avg_value, count=new_count)

Expand Down
Loading