From 02923db7ade503a31db24563857d29d1454aef13 Mon Sep 17 00:00:00 2001 From: Avik Pal Date: Thu, 27 Aug 2020 05:48:09 +0530 Subject: [PATCH] Fix TrackedReal nextfloat and prevfloat (#111) --- src/tracker.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tracker.jl b/src/tracker.jl index bb09734f..7625e232 100644 --- a/src/tracker.jl +++ b/src/tracker.jl @@ -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]