Skip to content

Commit

Permalink
Update src/interface.jl
Browse files Browse the repository at this point in the history
Co-authored-by: Brian Chen <[email protected]>
  • Loading branch information
CarloLucibello and ToucheSir authored Oct 14, 2024
1 parent e8dae73 commit 8ceedbe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ function update(tree, model, grad, higher...)
end

function update!(::AbstractRule, model, grad, higher...)
error("""update! must be called with an optimiser state, not a rule.
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)`.
""")
"""))
end

function update!(tree, model, grad, higher...)
Expand Down

0 comments on commit 8ceedbe

Please sign in to comment.