Skip to content

Commit cd18efb

Browse files
authored
use new ChainRulesCore (#319)
1 parent 04ae807 commit cd18efb

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
88
OpenSpecFun_jll = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
99

1010
[compat]
11-
ChainRulesCore = "0.9.40"
12-
ChainRulesTestUtils = "0.6.8"
11+
ChainRulesCore = "0.9.44, 0.10"
12+
ChainRulesTestUtils = "0.6.8, 0.7"
1313
LogExpFunctions = "0.2"
1414
OpenSpecFun_jll = "0.5"
1515
julia = "1.3"

src/chainrules.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ ChainRulesCore.@scalar_rule(
105105
ChainRulesCore.@scalar_rule(
106106
polygamma(m, x),
107107
(
108-
ChainRulesCore.DoesNotExist(),
108+
ChainRulesCore.NoTangent(),
109109
polygamma(m + 1, x),
110110
),
111111
)
@@ -122,7 +122,11 @@ ChainRulesCore.@scalar_rule(
122122
)
123123

124124
# actually is the absolute value of the logorithm of gamma paired with sign gamma
125-
ChainRulesCore.@scalar_rule(logabsgamma(x), digamma(x), ChainRulesCore.Zero())
125+
ChainRulesCore.@scalar_rule(
126+
logabsgamma(x),
127+
digamma(x),
128+
ChainRulesCore.ZeroTangent()
129+
)
126130

127131
ChainRulesCore.@scalar_rule(loggamma(x), digamma(x))
128132
ChainRulesCore.@scalar_rule(

0 commit comments

Comments
 (0)