-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
friendly error when using rule instead of state #181
base: master
Are you sure you want to change the base?
Conversation
src/interface.jl
Outdated
error("""update! must be called with an optimiser state, not a rule. | ||
Call `opt_state = setup(rule, model)` first, then `update!(opt_state, model, grad)`. | ||
""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error("""update! must be called with an optimiser state, not a rule. | |
Call `opt_state = setup(rule, model)` first, then `update!(opt_state, model, grad)`. | |
""") | |
throw(ArgumentError("""update! must be called with an optimiser state tree, not a rule. | |
Call `opt_state = setup(rule, model)` first, then `update!(opt_state, model, grad)`. | |
""")) |
To better match language used elsewhere in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test needs to change to match, I think.
Co-authored-by: Brian Chen <[email protected]>
I like friendly errors, but I think this is going to produce ambiguities with Flux, method 7:
I guess we can fix that in Flux, but should not forget. |
No description provided.