Skip to content

Commit 595abfd

Browse files
authored
Merge pull request #668 from JuliaDiff/mz/ambiguities
resolve `rrule` ambiguities
2 parents fef6aa8 + 6950027 commit 595abfd

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ChainRules"
22
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
3-
version = "1.44.2"
3+
version = "1.44.3"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/rulesets/Base/nondiff.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,14 @@
5454
@non_differentiable invperm(::AbstractArray{Bool})
5555
@non_differentiable invpermute!(::Any, ::AbstractArray{Bool})
5656
@non_differentiable mapslices(::Any, ::AbstractArray{Bool})
57-
@non_differentiable Matrix(::AbstractArray{Bool})
5857
@non_differentiable ndims(::AbstractArray{Bool})
5958
@non_differentiable parent(::AbstractArray{Bool})
6059
@non_differentiable parentindices(::AbstractArray{Bool})
6160
@non_differentiable permute!(::AbstractArray{Bool}, ::Any)
6261
@non_differentiable permutedims(::AbstractArray{Bool})
6362
@non_differentiable permutedims(::AbstractArray{Bool}, ::Any)
6463
@non_differentiable promote_shape(::AbstractArray{Bool}, ::Any)
65-
@non_differentiable repeat(::AbstractArray{Bool}, ::Any...)
64+
@non_differentiable repeat(::AbstractArray{Bool}, ::Integer...)
6665
@non_differentiable reshape(::AbstractArray{Bool}, ::Any...)
6766
@non_differentiable reverse(::AbstractArray{Bool}, ::Any...)
6867
@non_differentiable reverse!(::AbstractArray{Bool}, ::Any...)
@@ -174,9 +173,11 @@
174173
@non_differentiable findall(::AbstractArray)
175174
@non_differentiable findfirst(::Union{Regex, AbstractString, Function, AbstractChar}, ::AbstractString)
176175
@non_differentiable findfirst(::Function, ::Any)
176+
@non_differentiable findfirst(::Function, ::AbstractString)
177177
@non_differentiable findfirst(::AbstractArray)
178178
@non_differentiable findlast(::Union{AbstractString, Function, AbstractChar}, ::AbstractString)
179179
@non_differentiable findlast(::Function, ::Any)
180+
@non_differentiable findlast(::Function, ::AbstractString)
180181
@non_differentiable findlast(::AbstractArray)
181182
@non_differentiable first(::AbstractChar)
182183
@non_differentiable first(::Cmd)

test/rulesets/Base/array.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ end
153153

154154
@test rrule(repeat, [1,2,3], 4)[2](ones(12))[2] == [4,4,4]
155155
@test rrule(repeat, [1,2,3], outer=4)[2](ones(12))[2] == [4,4,4]
156+
157+
test_rrule(repeat, [true, false], 3)
156158
end
157159

158160
@testset "hcat" begin

test/test_helpers.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,9 @@ ChainRulesCore.frule((_, Δx), ::typeof(flog), x::Number) = log(x), inv(x) * Δx
220220
test_frule(flog, 8.9 + im)
221221
end
222222

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

0 commit comments

Comments
 (0)