Skip to content

Commit

Permalink
Fix TrackedReal nextfloat and prevfloat (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal authored Aug 27, 2020
1 parent 05c5aa8 commit 02923db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/tracker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ Tracker.dual(x::Int, p) = x

Base.prevfloat(r::TrackedReal) = track(prevfloat, r)
@grad function prevfloat(r::Real)
prevfloat(data(r)), Δ -> Δ
prevfloat(data(r)), Δ -> (Δ,)
end
Base.nextfloat(r::TrackedReal) = track(nextfloat, r)
@grad function nextfloat(r::Real)
nextfloat(data(r)), Δ -> Δ
nextfloat(data(r)), Δ -> (Δ,)
end

for f = [:hcat, :vcat]
Expand Down

0 comments on commit 02923db

Please sign in to comment.