diff --git a/src/optimise/train.jl b/src/optimise/train.jl index ebcf9c16..8a6cf615 100644 --- a/src/optimise/train.jl +++ b/src/optimise/train.jl @@ -1,5 +1,6 @@ using Juno using Flux.Tracker: back! +import Base.depwarn runall(f) = f runall(fs::AbstractVector) = () -> foreach(call, fs) @@ -59,8 +60,10 @@ function train!(loss, data, opt; cb = () -> ()) l = loss(d...) @interrupts back!(l) opt() - cb() == :stop && break - @deprecate :stop Flux.stop() + if cb() == :stop + depwarn("Use of `:stop` is deprecated; use `Flux.stop()` instead", :stop) + break + end catch ex if ex isa StopException break