Skip to content

Commit

Permalink
Remove dual hack
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion committed Sep 7, 2022
1 parent 187b472 commit f3130be
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
7 changes: 0 additions & 7 deletions src/lib/real.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
3 changes: 2 additions & 1 deletion test/tracker.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

2 comments on commit f3130be

@ChrisRackauckas
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/67861

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.22 -m "<description of version>" f3130be18d50318eff0a2c889e2c27c3002ee69d
git push origin v0.2.22

Please sign in to comment.