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

@ -20,4 +20,4 @@ using Flux.Tracker: TrackedArray
Param(x::TrackedArray) = Param(x.data, x.grad)
# Base.convert(::Type{Param}, x::TrackedArray) = Param(x.data, x.grad)
end
end

View File

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