Skip to content

Commit 6f6bdba

Browse files
author
Miha Zgubic
committed
add @nondiff from Zygote
1 parent c518874 commit 6f6bdba

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
name = "ChainRules"
22
uuid = "082447d4-558c-5d27-93f4-14fc19e9eca2"
3-
version = "1.36"
3+
version = "1.37.0"
44

55
[deps]
66
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
77
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
8+
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
89
IrrationalConstants = "92d709cd-6900-40b7-9082-c6be49f344b6"
910
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1011
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

src/ChainRules.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module ChainRules
33
using Base.Broadcast: materialize, materialize!, broadcasted, Broadcasted, broadcastable
44
using ChainRulesCore
55
using Compat
6+
using Distributed
67
using IrrationalConstants: logtwo, logten
78
using LinearAlgebra
89
using LinearAlgebra.BLAS
@@ -34,6 +35,8 @@ include("rulesets/Base/indexing.jl")
3435
include("rulesets/Base/sort.jl")
3536
include("rulesets/Base/mapreduce.jl")
3637

38+
include("rulesets/Distributed/nondiff.jl")
39+
3740
include("rulesets/Statistics/statistics.jl")
3841

3942
include("rulesets/LinearAlgebra/utils.jl")

src/rulesets/Base/nondiff.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
##### Exported functions, alphabetically
9494
#####
9595

96+
@non_differentiable (:)(::Any...) # same as the Colon() singleton instance
97+
9698
@non_differentiable abspath(::AbstractString...)
9799
@non_differentiable all(::Any)
98100
@non_differentiable all(::Any, ::Any)
@@ -110,6 +112,7 @@
110112
@non_differentiable bytesavailable(::Any)
111113

112114
@non_differentiable CartesianIndices(::Any)
115+
@non_differentiable Channel(::Any...)
113116
@non_differentiable cd(::AbstractString)
114117
@non_differentiable ceil(::Any...)
115118
@non_differentiable chomp(::AbstractString)
@@ -470,6 +473,7 @@ elseif isdefined(Base, :cumulative_compile_time_ns)
470473
@non_differentiable Base.cumulative_compile_time_ns()
471474
end
472475
@non_differentiable Base.time_print(::Any...)
476+
@non_differentiable Base.OneTo(::Any...)
473477

474478
@non_differentiable Broadcast.combine_styles(::Any...)
475479
@non_differentiable Broadcast.result_style(::Any)

src/rulesets/Distributed/nondiff.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@non_differentiable Distributed.CachingPool(::Any...)
2+
@non_differentiable Distributed.WorkerPool(::Any...)
3+
@non_differentiable workers()

0 commit comments

Comments
 (0)