From 098d6a8c52c179dc51c8cc241cc22b9a49f36d33 Mon Sep 17 00:00:00 2001 From: WT Date: Mon, 28 Mar 2022 21:20:11 +0100 Subject: [PATCH 1/4] Remove bad rules --- src/rulesets/Random/random.jl | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/rulesets/Random/random.jl b/src/rulesets/Random/random.jl index d1eeab514..57ccd6b06 100644 --- a/src/rulesets/Random/random.jl +++ b/src/rulesets/Random/random.jl @@ -19,11 +19,6 @@ end @non_differentiable rand(::Type{<:Real}, ::Integer...) @non_differentiable rand(::Integer...) -# There are many different 1-3 arg methods, but not varargs -@non_differentiable rand!(::Any) -@non_differentiable rand!(::Any, ::Any) -@non_differentiable rand!(::Any, ::Any, ::Any) - @non_differentiable randexp(::Any...) @non_differentiable randexp!(::AbstractArray) From cae34fa5bbed224c5ade7e1259457d5b29377268 Mon Sep 17 00:00:00 2001 From: WT Date: Mon, 28 Mar 2022 21:20:22 +0100 Subject: [PATCH 2/4] Bump patch --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index bfcd14aef..40efd955f 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ChainRules" uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2" -version = "1.28.1" +version = "1.28.2" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" From 108afcbe6849a61c63ae532f65b7626a2f4e1f57 Mon Sep 17 00:00:00 2001 From: WT Date: Tue, 29 Mar 2022 08:30:13 +0100 Subject: [PATCH 3/4] Add back in some more specific methods --- src/rulesets/Random/random.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rulesets/Random/random.jl b/src/rulesets/Random/random.jl index 57ccd6b06..a6f81b463 100644 --- a/src/rulesets/Random/random.jl +++ b/src/rulesets/Random/random.jl @@ -19,6 +19,9 @@ end @non_differentiable rand(::Type{<:Real}, ::Integer...) @non_differentiable rand(::Integer...) +@non_differentiable rand!(::AbstractArray) +@non_differentiable rand!(::AbstractRNG, ::AbstractArray) + @non_differentiable randexp(::Any...) @non_differentiable randexp!(::AbstractArray) From 40c14cec328ad1f663d2faffeb2b00558b37055c Mon Sep 17 00:00:00 2001 From: WT Date: Wed, 30 Mar 2022 09:06:47 +0100 Subject: [PATCH 4/4] More rules --- src/rulesets/Random/random.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/rulesets/Random/random.jl b/src/rulesets/Random/random.jl index a6f81b463..9a08f8551 100644 --- a/src/rulesets/Random/random.jl +++ b/src/rulesets/Random/random.jl @@ -21,6 +21,7 @@ end @non_differentiable rand!(::AbstractArray) @non_differentiable rand!(::AbstractRNG, ::AbstractArray) +@non_differentiable rand!(::AbstractRNG, ::AbstractArray, ::Type) @non_differentiable randexp(::Any...)