From f3130be18d50318eff0a2c889e2c27c3002ee69d Mon Sep 17 00:00:00 2001 From: David Widmann Date: Wed, 7 Sep 2022 21:25:19 +0200 Subject: [PATCH] Remove dual hack --- Project.toml | 2 +- src/lib/real.jl | 7 ------- test/tracker.jl | 3 ++- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Project.toml b/Project.toml index cdf0a18..3b71db0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Tracker" uuid = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" -version = "0.2.21" +version = "0.2.22" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" diff --git a/src/lib/real.jl b/src/lib/real.jl index 833a7e1..9c93cd0 100644 --- a/src/lib/real.jl +++ b/src/lib/real.jl @@ -103,13 +103,6 @@ import Base:^ ^(a::TrackedReal, b::Integer) = track(^, a, b) -# Hack for conversions - -using ForwardDiff: Dual - -(T::Type{<:Real})(x::Dual) = Dual(T(x.value), map(T, x.partials.values)) -(Dual{T,V,N})(x::Dual) where {T,V,N} = invoke(Dual{T,V,N}, Tuple{Number}, x) - # Tuples struct TrackedTuple{T<:Tuple} diff --git a/test/tracker.jl b/test/tracker.jl index 97dddcc..c8ed40a 100644 --- a/test/tracker.jl +++ b/test/tracker.jl @@ -339,7 +339,8 @@ end end end -@test gradtest(x -> Float64.(x), 5) +# Upstream issue: https://github.com/JuliaDiff/ForwardDiff.jl/pull/538 +@test_broken gradtest(x -> Float64.(x), 5) @testset "equality & order" begin # TrackedReal