Skip to content

Commit

Permalink
Merge pull request #132 from JuliaDiff/dw/bigfloat
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Mar 31, 2021
2 parents 15ddc59 + 08d0c8d commit 0833088
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ChainRulesTestUtils"
uuid = "cdddcdb0-9152-4a09-a978-84456f9df70a"
version = "0.6.4"
version = "0.6.5"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
3 changes: 3 additions & 0 deletions src/generate_tangent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ rand_tangent(rng::AbstractRNG, x::Integer) = DoesNotExist()

rand_tangent(rng::AbstractRNG, x::T) where {T<:Number} = randn(rng, T)

# ref: https://github.com/JuliaLang/julia/issues/17629
rand_tangent(rng::AbstractRNG, ::BigFloat) = big(randn(rng))

rand_tangent(rng::AbstractRNG, x::StridedArray) = rand_tangent.(Ref(rng), x)

function rand_tangent(rng::AbstractRNG, x::T) where {T<:Tuple}
Expand Down
1 change: 1 addition & 0 deletions test/generate_tangent.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ end
(true, DoesNotExist),
(4, DoesNotExist),
(5.0, Float64),
(big(5.0), BigFloat),
(5.0 + 0.4im, Complex{Float64}),
(randn(Float32, 3), Vector{Float32}),
(randn(Complex{Float64}, 2), Vector{Complex{Float64}}),
Expand Down

2 comments on commit 0833088

@devmotion
Copy link
Member Author

Choose a reason for hiding this comment

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

@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/33237

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.6.5 -m "<description of version>" 08330882f8a98b34c06cad43b09b9e785648dd9a
git push origin v0.6.5

Please sign in to comment.