Skip to content

Commit

Permalink
update the deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Miha Zgubic committed Sep 9, 2020
1 parent ef63558 commit c625e45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/compiler/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ tailmemaybe(::Nothing) = nothing
tailmemaybe(x::Tuple) = Base.tail(x)

replacezero(x) = x
replacezero(::Nothing) = @warn "Use of 'nothing' to represent zero gradients is deprecated, use Zero() or DoesNotExist() from ChainRules"; return nothing
replacezero(::Nothing) = Base.depwarn("Use of 'nothing' to represent zero gradients is deprecated, use Zero() or DoesNotExist() from ChainRules", :replacezero); return nothing
replacezero(::AbstractZero) = nothing
replacezero(t::Tuple) = ntuple(i -> replacezero(t[i]), length(t))

Expand Down
2 changes: 1 addition & 1 deletion src/lib/lib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ unapply(t, xs) = _unapply(t, xs)[1]
if Δ isa AbstractZero
return Δ
elseif Δ === nothing
println("hit 'nothing' in Core._apply")
println("hit 'nothing' in Core._apply")
return Zero()
else
(first(Δ), unapply(st, Base.tail(Δ))...)
Expand Down

0 comments on commit c625e45

Please sign in to comment.