Skip to content

Commit

Permalink
Merge pull request #668 from JuliaDiff/mz/ambiguities
Browse files Browse the repository at this point in the history
resolve `rrule` ambiguities
  • Loading branch information
mzgubic authored Aug 22, 2022
2 parents fef6aa8 + 6950027 commit 595abfd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ChainRules"
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
version = "1.44.2"
version = "1.44.3"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
5 changes: 3 additions & 2 deletions src/rulesets/Base/nondiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,14 @@
@non_differentiable invperm(::AbstractArray{Bool})
@non_differentiable invpermute!(::Any, ::AbstractArray{Bool})
@non_differentiable mapslices(::Any, ::AbstractArray{Bool})
@non_differentiable Matrix(::AbstractArray{Bool})
@non_differentiable ndims(::AbstractArray{Bool})
@non_differentiable parent(::AbstractArray{Bool})
@non_differentiable parentindices(::AbstractArray{Bool})
@non_differentiable permute!(::AbstractArray{Bool}, ::Any)
@non_differentiable permutedims(::AbstractArray{Bool})
@non_differentiable permutedims(::AbstractArray{Bool}, ::Any)
@non_differentiable promote_shape(::AbstractArray{Bool}, ::Any)
@non_differentiable repeat(::AbstractArray{Bool}, ::Any...)
@non_differentiable repeat(::AbstractArray{Bool}, ::Integer...)
@non_differentiable reshape(::AbstractArray{Bool}, ::Any...)
@non_differentiable reverse(::AbstractArray{Bool}, ::Any...)
@non_differentiable reverse!(::AbstractArray{Bool}, ::Any...)
Expand Down Expand Up @@ -174,9 +173,11 @@
@non_differentiable findall(::AbstractArray)
@non_differentiable findfirst(::Union{Regex, AbstractString, Function, AbstractChar}, ::AbstractString)
@non_differentiable findfirst(::Function, ::Any)
@non_differentiable findfirst(::Function, ::AbstractString)
@non_differentiable findfirst(::AbstractArray)
@non_differentiable findlast(::Union{AbstractString, Function, AbstractChar}, ::AbstractString)
@non_differentiable findlast(::Function, ::Any)
@non_differentiable findlast(::Function, ::AbstractString)
@non_differentiable findlast(::AbstractArray)
@non_differentiable first(::AbstractChar)
@non_differentiable first(::Cmd)
Expand Down
2 changes: 2 additions & 0 deletions test/rulesets/Base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ end

@test rrule(repeat, [1,2,3], 4)[2](ones(12))[2] == [4,4,4]
@test rrule(repeat, [1,2,3], outer=4)[2](ones(12))[2] == [4,4,4]

test_rrule(repeat, [true, false], 3)
end

@testset "hcat" begin
Expand Down
5 changes: 5 additions & 0 deletions test/test_helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,9 @@ ChainRulesCore.frule((_, Δx), ::typeof(flog), x::Number) = log(x), inv(x) * Δx
test_frule(flog, 8.9 + im)
end

@testset "ambiguities" begin
@test [] == filter(Test.detect_ambiguities(ChainRules, ChainRulesCore)) do t
(t[1].name in [:rrule, Symbol("rrule##kw")])
end
end
end

2 comments on commit 595abfd

@mzgubic
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/66789

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 v1.44.3 -m "<description of version>" 595abfd3e5e3c6ec23ca50d44a713b0783d17f5f
git push origin v1.44.3

Please sign in to comment.