@@ -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.
1212struct 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