added deprecation warning

This commit is contained in:
Dhairya Gandhi 2018-08-24 13:08:03 +05:30
parent a7ad620f01
commit c035fe22d7
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,6 @@
using Juno using Juno
using Flux.Tracker: back! using Flux.Tracker: back!
import Base.depwarn
runall(f) = f runall(f) = f
runall(fs::AbstractVector) = () -> foreach(call, fs) runall(fs::AbstractVector) = () -> foreach(call, fs)
@ -59,7 +60,10 @@ function train!(loss, data, opt; cb = () -> ())
l = loss(d...) l = loss(d...)
@interrupts back!(l) @interrupts back!(l)
opt() opt()
cb() == :stop && break if cb() == :stop
depwarn("Use of `:stop` is deprecated; use `Flux.stop()` instead", :stop)
break
end
catch ex catch ex
if ex isa StopException if ex isa StopException
break break