Skip to content

Commit 5732b97

Browse files
authored
Update bias_act.jl (#618)
1 parent be9c1c8 commit 5732b97

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bias_act.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const RCR = RuleConfig{>:HasReverseMode}
88
@inline only_derivative(y,f::F,x) where F = only(only(ChainRulesCore.derivatives_given_output(y, f, x)))
99

1010
# This has no methods, used for testing whether `derivatives_given_output(Ω, f, x)`
11-
# is independent of `x`, as `_return_type` says `Union{}` when calling is an error.
11+
# is independent of `x`, as `return_type` says `Union{}` when calling is an error.
1212
struct NotaNumber <: Real end
1313

1414
"""
@@ -57,7 +57,7 @@ function ChainRulesCore.rrule(cfg::RCR, ::typeof(bias_act!), σ::F, x::AbstractA
5757
end
5858

5959
# Fast path: it is now safe to overwrite x, since this is not needed for gradient of σ
60-
if isconcretetype(Core.Compiler._return_type(only_derivative, Tuple{T, F, NotaNumber}))
60+
if isconcretetype(Core.Compiler.return_type(only_derivative, Tuple{T, F, NotaNumber}))
6161
Ω = bias_act!(σ, x, b) # now x === Ω, when x isa StridedArray{<:AbstractFloat}
6262
function bias_act!_fastback(Δ)
6363
# Tempting to overwrite x again, but only safe if you call pullback at most once,
@@ -70,7 +70,7 @@ function ChainRulesCore.rrule(cfg::RCR, ::typeof(bias_act!), σ::F, x::AbstractA
7070

7171
# # Slower path: can't overwrite x, but can use derivatives_given_output
7272
# # This case is WRONG and tests fail, but not sure why
73-
# elseif isconcretetype(Core.Compiler._return_type(only_derivative, Tuple{T, F, T}))
73+
# elseif isconcretetype(Core.Compiler.return_type(only_derivative, Tuple{T, F, T}))
7474
# Ω2 = fast_act(σ, x).(x) .+ b
7575
# @show σ b
7676
# function bias_act!_back2(Δ)

0 commit comments

Comments
 (0)