From e73e54cbeade89f24d376be7ec3ab751374cf7c1 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Thu, 19 Nov 2020 13:24:14 +0530 Subject: [PATCH 01/12] non-differentiability of ops on BitArrays Fixes #293 --- src/rulesets/Base/nondiff.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/rulesets/Base/nondiff.jl b/src/rulesets/Base/nondiff.jl index ede42ac31..4805da512 100644 --- a/src/rulesets/Base/nondiff.jl +++ b/src/rulesets/Base/nondiff.jl @@ -22,6 +22,13 @@ @non_differentiable ==(::Any, ::Any) @non_differentiable ===(::Any, ::Any) +@non_differentiable accumulate(::Any, ::BitArray; kwargs...) +@non_differentiable accumulate!(::Any, ::Any, ::BitArray; kwargs...) +@non_differentiable cumprod(::BitArray; kwargs...) +@non_differentiable cumprod!(::Any, ::BitArray; kwargs...) +@non_differentiable cumsum(::BitArray; kwargs...) +@non_differentiable cumsum!(::Any, ::BitArray; kwargs...) + @non_differentiable abspath(::AbstractString) @non_differentiable abspath(::AbstractString, ::AbstractString) @non_differentiable all(::Any) From 9ff61b7c714bf6a2bb71071d2c5d10dd3d39c3b5 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Thu, 19 Nov 2020 15:30:06 +0530 Subject: [PATCH 02/12] add few more non differentialble ops on BitArrays --- src/rulesets/Base/nondiff.jl | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/rulesets/Base/nondiff.jl b/src/rulesets/Base/nondiff.jl index 4805da512..f19513537 100644 --- a/src/rulesets/Base/nondiff.jl +++ b/src/rulesets/Base/nondiff.jl @@ -22,12 +22,20 @@ @non_differentiable ==(::Any, ::Any) @non_differentiable ===(::Any, ::Any) -@non_differentiable accumulate(::Any, ::BitArray; kwargs...) -@non_differentiable accumulate!(::Any, ::Any, ::BitArray; kwargs...) -@non_differentiable cumprod(::BitArray; kwargs...) -@non_differentiable cumprod!(::Any, ::BitArray; kwargs...) -@non_differentiable cumsum(::BitArray; kwargs...) -@non_differentiable cumsum!(::Any, ::BitArray; kwargs...) +@non_differentiable accumulate(::Any, ::BitArray) +@non_differentiable accumulate!(::Any, ::Any, ::BitArray) +@non_differentiable Array(::BitArray) +@non_differentiable cumprod(::BitArray) +@non_differentiable cumprod!(::Any, ::BitArray) +@non_differentiable cumsum(::BitArray) +@non_differentiable cumsum!(::Any, ::BitArray) +@non_differentiable DenseMatrix(::BitArray) +@non_differentiable Matrix(::BitArray) +@non_differentiable ndims(::BitArray) +@non_differentiable similar(::BitArray, ::Any) +@non_differentiable size(::BitArray) +@non_differentiable size(::BitArray, ::Int) +@non_differentiable Vector(::BitArray) @non_differentiable abspath(::AbstractString) @non_differentiable abspath(::AbstractString, ::AbstractString) From a5bdbce0d38de1a2c4919bca6d6090253ac0ea4e Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Thu, 19 Nov 2020 16:02:38 +0530 Subject: [PATCH 03/12] add more ops --- src/rulesets/Base/nondiff.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rulesets/Base/nondiff.jl b/src/rulesets/Base/nondiff.jl index f19513537..6aac21238 100644 --- a/src/rulesets/Base/nondiff.jl +++ b/src/rulesets/Base/nondiff.jl @@ -25,11 +25,19 @@ @non_differentiable accumulate(::Any, ::BitArray) @non_differentiable accumulate!(::Any, ::Any, ::BitArray) @non_differentiable Array(::BitArray) +@non_differentiable axes(::BitArray) +@non_differentiable axes(::BitArray, ::Int) +@non_differentiable conj(::BitArray) @non_differentiable cumprod(::BitArray) @non_differentiable cumprod!(::Any, ::BitArray) @non_differentiable cumsum(::BitArray) @non_differentiable cumsum!(::Any, ::BitArray) @non_differentiable DenseMatrix(::BitArray) +@non_differentiable eachindex(::BitArray) +@non_differentiable getindex(::BitArray, ::Any) +@non_differentiable IndexStyle(::BitArray) +@non_differentiable isassigned(::BitArray, ::Int) +@non_differentiable length(::BitArray) @non_differentiable Matrix(::BitArray) @non_differentiable ndims(::BitArray) @non_differentiable similar(::BitArray, ::Any) From b60b00fcde5af3194ea1cc78ea39934876c8bbc8 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Fri, 20 Nov 2020 10:28:22 +0530 Subject: [PATCH 04/12] remove non-diff rules for which ::Any rule present --- src/rulesets/Base/nondiff.jl | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/rulesets/Base/nondiff.jl b/src/rulesets/Base/nondiff.jl index 6aac21238..abf200ab1 100644 --- a/src/rulesets/Base/nondiff.jl +++ b/src/rulesets/Base/nondiff.jl @@ -25,24 +25,17 @@ @non_differentiable accumulate(::Any, ::BitArray) @non_differentiable accumulate!(::Any, ::Any, ::BitArray) @non_differentiable Array(::BitArray) -@non_differentiable axes(::BitArray) -@non_differentiable axes(::BitArray, ::Int) @non_differentiable conj(::BitArray) @non_differentiable cumprod(::BitArray) @non_differentiable cumprod!(::Any, ::BitArray) @non_differentiable cumsum(::BitArray) @non_differentiable cumsum!(::Any, ::BitArray) @non_differentiable DenseMatrix(::BitArray) -@non_differentiable eachindex(::BitArray) @non_differentiable getindex(::BitArray, ::Any) @non_differentiable IndexStyle(::BitArray) -@non_differentiable isassigned(::BitArray, ::Int) -@non_differentiable length(::BitArray) @non_differentiable Matrix(::BitArray) @non_differentiable ndims(::BitArray) @non_differentiable similar(::BitArray, ::Any) -@non_differentiable size(::BitArray) -@non_differentiable size(::BitArray, ::Int) @non_differentiable Vector(::BitArray) @non_differentiable abspath(::AbstractString) From 8a614ed976d2a149f34ec557606f2324025fd677 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Sat, 21 Nov 2020 21:40:00 +0530 Subject: [PATCH 05/12] add more rules for non-diff --- src/rulesets/Base/nondiff.jl | 59 +++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/src/rulesets/Base/nondiff.jl b/src/rulesets/Base/nondiff.jl index abf200ab1..f3dbe60df 100644 --- a/src/rulesets/Base/nondiff.jl +++ b/src/rulesets/Base/nondiff.jl @@ -22,21 +22,50 @@ @non_differentiable ==(::Any, ::Any) @non_differentiable ===(::Any, ::Any) -@non_differentiable accumulate(::Any, ::BitArray) -@non_differentiable accumulate!(::Any, ::Any, ::BitArray) -@non_differentiable Array(::BitArray) -@non_differentiable conj(::BitArray) -@non_differentiable cumprod(::BitArray) -@non_differentiable cumprod!(::Any, ::BitArray) -@non_differentiable cumsum(::BitArray) -@non_differentiable cumsum!(::Any, ::BitArray) -@non_differentiable DenseMatrix(::BitArray) -@non_differentiable getindex(::BitArray, ::Any) -@non_differentiable IndexStyle(::BitArray) -@non_differentiable Matrix(::BitArray) -@non_differentiable ndims(::BitArray) -@non_differentiable similar(::BitArray, ::Any) -@non_differentiable Vector(::BitArray) +@non_differentiable accumulate(::Any, ::AbstractArray{Bool}) +@non_differentiable accumulate!(::Any, ::Any, ::AbstractArray{Bool}) +@non_differentiable conj(::AbstractArray{Bool}) +@non_differentiable conj!(::AbstractArray{Bool}) +@non_differentiable cumprod(::AbstractArray{Bool}) +@non_differentiable cumprod!(::Any, ::AbstractArray{Bool}) +@non_differentiable cumsum(::AbstractArray{Bool}) +@non_differentiable cumsum!(::Any, ::AbstractArray{Bool}) +@non_differentiable DenseMatrix(::AbstractArray{Bool}) +@non_differentiable diff(::AbstractArray{Bool}) +@non_differentiable eachcol(::AbstractArray{Bool}) +@non_differentiable eachrow(::AbstractArray{Bool}) +@non_differentiable eachslice(::AbstractArray{Bool}) +@non_differentiable fill(::AbstractArray{Bool}) +@non_differentiable fill!(::AbstractArray, ::Any) +@non_differentiable getindex(::AbstractArray{Bool}, ::Any) +@non_differentiable isperm(::AbstractArray{Bool}) +# reverseind +# selectdim +# parentindices +@non_differentiable invperm(::AbstractArray{Bool}) +@non_differentiable invpermute!(::AbstractArray{Bool}, ::Any) +@non_differentiable mapslices(::Any, ::AbstractArray{Bool}) +@non_differentiable Matrix(::AbstractArray{Bool}) +@non_differentiable ndims(::AbstractArray{Bool}) +@non_differentiable parent(::AbstractArray{Bool}) +@non_differentiable permute!(::AbstractArray{Bool}, ::Any) +@non_differentiable repeat(::AbstractArray{Bool}) +@non_differentiable repeat(::AbstractArray{Bool}, ::Any) +@non_differentiable repeat(::AbstractArray{Bool}, ::Any, ::Any) +@non_differentiable reverse(::AbstractArray{Bool}) +@non_differentiable reverse!(::AbstractArray{Bool}) +@non_differentiable rot180(::AbstractArray{Bool}) +@non_differentiable rot180(::AbstractArray{Bool}, ::Any) +@non_differentiable rotl90(::AbstractArray{Bool}) +@non_differentiable rotl90(::AbstractArray{Bool}, ::Any) +@non_differentiable rotr90(::AbstractArray{Bool}) +@non_differentiable rotr90(::AbstractArray{Bool}, ::Any) +@non_differentiable similar(::AbstractArray{Bool}) +@non_differentiable similar(::AbstractArray{Bool}, ::Any) +@non_differentiable Vector(::AbstractArray{Bool}) + +@non_differentiable Array(::AbstractArray{Bool}) +@non_differentiable IndexStyle(::AbstractArray{Bool}) @non_differentiable abspath(::AbstractString) @non_differentiable abspath(::AbstractString, ::AbstractString) From 64efb6dc88632f1688183e93cd46072f54cb5019 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Thu, 26 Nov 2020 12:48:54 +0530 Subject: [PATCH 06/12] add more rules --- src/rulesets/Base/nondiff.jl | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/src/rulesets/Base/nondiff.jl b/src/rulesets/Base/nondiff.jl index f3dbe60df..c9d2eb089 100644 --- a/src/rulesets/Base/nondiff.jl +++ b/src/rulesets/Base/nondiff.jl @@ -22,36 +22,58 @@ @non_differentiable ==(::Any, ::Any) @non_differentiable ===(::Any, ::Any) +# vcat +# hcat +# hvcat +# vect +# findprev +# promote_shape @non_differentiable accumulate(::Any, ::AbstractArray{Bool}) @non_differentiable accumulate!(::Any, ::Any, ::AbstractArray{Bool}) +@non_differentiable cat(::AbstractArray{Bool}) +@non_differentiable circcopy!(::Any, ::AbstractArray{Bool}) +@non_differentiable circshift(::AbstractArray{Bool}, ::Any) +@non_differentiable circshift!(::Any, ::AbstractArray{Bool}, ::Any) +@non_differentiable circshift!(::AbstractArray{Bool}, ::Any) @non_differentiable conj(::AbstractArray{Bool}) @non_differentiable conj!(::AbstractArray{Bool}) @non_differentiable cumprod(::AbstractArray{Bool}) @non_differentiable cumprod!(::Any, ::AbstractArray{Bool}) @non_differentiable cumsum(::AbstractArray{Bool}) @non_differentiable cumsum!(::Any, ::AbstractArray{Bool}) -@non_differentiable DenseMatrix(::AbstractArray{Bool}) @non_differentiable diff(::AbstractArray{Bool}) +@non_differentiable dropdims(::AbstractArray{Bool}) @non_differentiable eachcol(::AbstractArray{Bool}) @non_differentiable eachrow(::AbstractArray{Bool}) @non_differentiable eachslice(::AbstractArray{Bool}) @non_differentiable fill(::AbstractArray{Bool}) @non_differentiable fill!(::AbstractArray, ::Any) +@non_differentiable findall(::AbstractArray{Bool}) +@non_differentiable findfirst(::AbstractArray{Bool}) +@non_differentiable findfirst(::Any, ::AbstractArray{Bool}) +@non_differentiable findlast(::AbstractArray{Bool}) +@non_differentiable findlast(::Any, ::AbstractArray{Bool}) @non_differentiable getindex(::AbstractArray{Bool}, ::Any) @non_differentiable isperm(::AbstractArray{Bool}) # reverseind -# selectdim -# parentindices @non_differentiable invperm(::AbstractArray{Bool}) @non_differentiable invpermute!(::AbstractArray{Bool}, ::Any) @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, ::Any) @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}) @non_differentiable repeat(::AbstractArray{Bool}, ::Any) @non_differentiable repeat(::AbstractArray{Bool}, ::Any, ::Any) +@non_differentiable reshape(::AbstractArray{Bool}, ::Any) +# requires Vararg support +#@non_differentiable reshape(::AbstractArray{Bool}, ::Vararg{Any}) @non_differentiable reverse(::AbstractArray{Bool}) @non_differentiable reverse!(::AbstractArray{Bool}) @non_differentiable rot180(::AbstractArray{Bool}) @@ -60,8 +82,13 @@ @non_differentiable rotl90(::AbstractArray{Bool}, ::Any) @non_differentiable rotr90(::AbstractArray{Bool}) @non_differentiable rotr90(::AbstractArray{Bool}, ::Any) +@non_differentiable selectdim(::AbstractArray{Bool}, ::Any, ::Any) +@non_differentiable setindex!(::AbstractArray{Bool}, ::Any, ::Any) @non_differentiable similar(::AbstractArray{Bool}) @non_differentiable similar(::AbstractArray{Bool}, ::Any) +@non_differentiable stride(::AbstractArray{Bool}, ::Any) +@non_differentiable strides(::AbstractArray{Bool}) +@non_differentiable vec(::AbstractArray{Bool}) @non_differentiable Vector(::AbstractArray{Bool}) @non_differentiable Array(::AbstractArray{Bool}) From 55f34079d53da58f88e3cc40ce3f5a01c1806411 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Sat, 28 Nov 2020 17:54:40 +0530 Subject: [PATCH 07/12] add more rules for non-diff --- src/rulesets/Base/nondiff.jl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/rulesets/Base/nondiff.jl b/src/rulesets/Base/nondiff.jl index c9d2eb089..6bd580570 100644 --- a/src/rulesets/Base/nondiff.jl +++ b/src/rulesets/Base/nondiff.jl @@ -22,12 +22,9 @@ @non_differentiable ==(::Any, ::Any) @non_differentiable ===(::Any, ::Any) -# vcat -# hcat -# hvcat -# vect -# findprev -# promote_shape + +@non_differentiable Bool(::Any) + @non_differentiable accumulate(::Any, ::AbstractArray{Bool}) @non_differentiable accumulate!(::Any, ::Any, ::AbstractArray{Bool}) @non_differentiable cat(::AbstractArray{Bool}) @@ -53,7 +50,11 @@ @non_differentiable findfirst(::Any, ::AbstractArray{Bool}) @non_differentiable findlast(::AbstractArray{Bool}) @non_differentiable findlast(::Any, ::AbstractArray{Bool}) +@non_differentiable findprev(::AbstractArray{Bool}, ::Any) +@non_differentiable findprev(::Any, ::AbstractArray{Bool}, ::Any) @non_differentiable getindex(::AbstractArray{Bool}, ::Any) +@non_differentiable hcat(::AbstractArray{Bool}) +@non_differentiable hvcat(::Any, ::AbstractArray{Bool}) @non_differentiable isperm(::AbstractArray{Bool}) # reverseind @non_differentiable invperm(::AbstractArray{Bool}) @@ -88,6 +89,7 @@ @non_differentiable similar(::AbstractArray{Bool}, ::Any) @non_differentiable stride(::AbstractArray{Bool}, ::Any) @non_differentiable strides(::AbstractArray{Bool}) +@non_differentiable vcat(::AbstractArray{Bool}) @non_differentiable vec(::AbstractArray{Bool}) @non_differentiable Vector(::AbstractArray{Bool}) From dd0d02f5f26f318bb9ebcd1c16b45f0f38d106d0 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Wed, 2 Dec 2020 12:58:22 +0530 Subject: [PATCH 08/12] use Vararg support of @non_differentiable --- src/rulesets/Base/nondiff.jl | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/src/rulesets/Base/nondiff.jl b/src/rulesets/Base/nondiff.jl index 6bd580570..96c065246 100644 --- a/src/rulesets/Base/nondiff.jl +++ b/src/rulesets/Base/nondiff.jl @@ -27,7 +27,7 @@ @non_differentiable accumulate(::Any, ::AbstractArray{Bool}) @non_differentiable accumulate!(::Any, ::Any, ::AbstractArray{Bool}) -@non_differentiable cat(::AbstractArray{Bool}) +@non_differentiable cat(::AbstractArray{Bool}...) @non_differentiable circcopy!(::Any, ::AbstractArray{Bool}) @non_differentiable circshift(::AbstractArray{Bool}, ::Any) @non_differentiable circshift!(::Any, ::AbstractArray{Bool}, ::Any) @@ -45,38 +45,28 @@ @non_differentiable eachslice(::AbstractArray{Bool}) @non_differentiable fill(::AbstractArray{Bool}) @non_differentiable fill!(::AbstractArray, ::Any) -@non_differentiable findall(::AbstractArray{Bool}) -@non_differentiable findfirst(::AbstractArray{Bool}) -@non_differentiable findfirst(::Any, ::AbstractArray{Bool}) -@non_differentiable findlast(::AbstractArray{Bool}) -@non_differentiable findlast(::Any, ::AbstractArray{Bool}) @non_differentiable findprev(::AbstractArray{Bool}, ::Any) @non_differentiable findprev(::Any, ::AbstractArray{Bool}, ::Any) -@non_differentiable getindex(::AbstractArray{Bool}, ::Any) -@non_differentiable hcat(::AbstractArray{Bool}) -@non_differentiable hvcat(::Any, ::AbstractArray{Bool}) +@non_differentiable getindex(::AbstractArray{Bool}, ::Any...) +@non_differentiable hcat(::AbstractArray{Bool}...) +@non_differentiable hvcat(::Any, ::AbstractArray{Bool}...) @non_differentiable isperm(::AbstractArray{Bool}) -# reverseind @non_differentiable invperm(::AbstractArray{Bool}) -@non_differentiable invpermute!(::AbstractArray{Bool}, ::Any) +@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, ::Any) @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}) -@non_differentiable repeat(::AbstractArray{Bool}, ::Any) -@non_differentiable repeat(::AbstractArray{Bool}, ::Any, ::Any) -@non_differentiable reshape(::AbstractArray{Bool}, ::Any) -# requires Vararg support -#@non_differentiable reshape(::AbstractArray{Bool}, ::Vararg{Any}) +@non_differentiable repeat(::AbstractArray{Bool}, ::Any...) +@non_differentiable reshape(::AbstractArray{Bool}, ::Any...) @non_differentiable reverse(::AbstractArray{Bool}) @non_differentiable reverse!(::AbstractArray{Bool}) +@non_differentiable reverseind(::AbstractArray{Bool}, ::Any) @non_differentiable rot180(::AbstractArray{Bool}) @non_differentiable rot180(::AbstractArray{Bool}, ::Any) @non_differentiable rotl90(::AbstractArray{Bool}) @@ -86,10 +76,10 @@ @non_differentiable selectdim(::AbstractArray{Bool}, ::Any, ::Any) @non_differentiable setindex!(::AbstractArray{Bool}, ::Any, ::Any) @non_differentiable similar(::AbstractArray{Bool}) -@non_differentiable similar(::AbstractArray{Bool}, ::Any) +@non_differentiable similar(::AbstractArray{Bool}, ::Any, ::Any...) @non_differentiable stride(::AbstractArray{Bool}, ::Any) @non_differentiable strides(::AbstractArray{Bool}) -@non_differentiable vcat(::AbstractArray{Bool}) +@non_differentiable vcat(::AbstractArray{Bool}...) @non_differentiable vec(::AbstractArray{Bool}) @non_differentiable Vector(::AbstractArray{Bool}) From 4fb91738d9670cf6f1c010a355ba7849f74a8ced Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Wed, 2 Dec 2020 13:18:14 +0530 Subject: [PATCH 09/12] bump versions of ChainRules and ChainRulesCore --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index 8eb6e4a35..ea116d034 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ChainRules" uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2" -version = "0.7.33" +version = "0.7.34" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" @@ -13,7 +13,7 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" [compat] -ChainRulesCore = "0.9.16" +ChainRulesCore = "0.9.21" ChainRulesTestUtils = "0.5" Compat = "3" FiniteDifferences = "0.11" From 541f63500c2fd39abef062b45485baa7011ebb27 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Wed, 2 Dec 2020 13:45:53 +0530 Subject: [PATCH 10/12] remove redundant rule --- src/rulesets/Base/nondiff.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/rulesets/Base/nondiff.jl b/src/rulesets/Base/nondiff.jl index 96c065246..4c52ba5b8 100644 --- a/src/rulesets/Base/nondiff.jl +++ b/src/rulesets/Base/nondiff.jl @@ -75,7 +75,6 @@ @non_differentiable rotr90(::AbstractArray{Bool}, ::Any) @non_differentiable selectdim(::AbstractArray{Bool}, ::Any, ::Any) @non_differentiable setindex!(::AbstractArray{Bool}, ::Any, ::Any) -@non_differentiable similar(::AbstractArray{Bool}) @non_differentiable similar(::AbstractArray{Bool}, ::Any, ::Any...) @non_differentiable stride(::AbstractArray{Bool}, ::Any) @non_differentiable strides(::AbstractArray{Bool}) From bd7bf7ee1984d052253bd51f6daef867f463f1e7 Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Wed, 2 Dec 2020 13:47:42 +0530 Subject: [PATCH 11/12] fix rule --- src/rulesets/Base/nondiff.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rulesets/Base/nondiff.jl b/src/rulesets/Base/nondiff.jl index 4c52ba5b8..09faa410f 100644 --- a/src/rulesets/Base/nondiff.jl +++ b/src/rulesets/Base/nondiff.jl @@ -75,7 +75,7 @@ @non_differentiable rotr90(::AbstractArray{Bool}, ::Any) @non_differentiable selectdim(::AbstractArray{Bool}, ::Any, ::Any) @non_differentiable setindex!(::AbstractArray{Bool}, ::Any, ::Any) -@non_differentiable similar(::AbstractArray{Bool}, ::Any, ::Any...) +@non_differentiable similar(::AbstractArray{Bool}, ::Any...) @non_differentiable stride(::AbstractArray{Bool}, ::Any) @non_differentiable strides(::AbstractArray{Bool}) @non_differentiable vcat(::AbstractArray{Bool}...) From 42ae3f251d7d1fe298c3fdb13b15d7692d659d9a Mon Sep 17 00:00:00 2001 From: Gaurav Dhingra Date: Thu, 3 Dec 2020 05:26:09 +0530 Subject: [PATCH 12/12] Update src/rulesets/Base/nondiff.jl Co-authored-by: Miha Zgubic --- src/rulesets/Base/nondiff.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rulesets/Base/nondiff.jl b/src/rulesets/Base/nondiff.jl index 09faa410f..6404d720e 100644 --- a/src/rulesets/Base/nondiff.jl +++ b/src/rulesets/Base/nondiff.jl @@ -64,8 +64,8 @@ @non_differentiable promote_shape(::AbstractArray{Bool}, ::Any) @non_differentiable repeat(::AbstractArray{Bool}, ::Any...) @non_differentiable reshape(::AbstractArray{Bool}, ::Any...) -@non_differentiable reverse(::AbstractArray{Bool}) -@non_differentiable reverse!(::AbstractArray{Bool}) +@non_differentiable reverse(::AbstractArray{Bool}, ::Any...) +@non_differentiable reverse!(::AbstractArray{Bool}, ::Any...) @non_differentiable reverseind(::AbstractArray{Bool}, ::Any) @non_differentiable rot180(::AbstractArray{Bool}) @non_differentiable rot180(::AbstractArray{Bool}, ::Any)