Skip to content

Commit c0108b2

Browse files
committed
Use Core.Compiler.return_type
1 parent 77ceb51 commit c0108b2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/rulesets/Base/broadcast.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ end
4848
# Path 2: This is roughly what `derivatives_given_output` is designed for, should be fast.
4949

5050
function may_bc_derivatives(::Type{T}, f::F, args::Vararg{Any,N}) where {T,F,N}
51-
= Base._return_type(derivatives_given_output, Tuple{T, F, map(_eltype, args)...})
51+
= Core.Compiler.return_type(derivatives_given_output, Tuple{T, F, map(_eltype, args)...})
5252
return isconcretetype(TΔ)
5353
end
5454

@@ -98,7 +98,7 @@ function may_bc_forwards(cfg::C, f::F, arg) where {C,F}
9898
TA = _eltype(arg)
9999
TA <: Real || return false
100100
cfg isa RuleConfig{>:HasForwardsMode} && return true # allows frule_via_ad
101-
TF = Base._return_type(frule, Tuple{C, Tuple{NoTangent, TA}, F, TA})
101+
TF = Core.Compiler.return_type(frule, Tuple{C, Tuple{NoTangent, TA}, F, TA})
102102
return isconcretetype(TF) && TF <: Tuple
103103
end
104104

src/rulesets/Base/mapreduce.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Works by seeing if the result of `derivatives_given_output(nothing, f, x)` can b
139139
The method of `derivatives_given_output` usually comes from `@scalar_rule`.
140140
"""
141141
function _uses_input_only(f::F, ::Type{xT}) where {F,xT}
142-
gT = Base._return_type(derivatives_given_output, Tuple{Nothing, F, xT})
142+
gT = Core.Compiler.return_type(derivatives_given_output, Tuple{Nothing, F, xT})
143143
# Here we must check `<: Number`, to avoid this, the one rule which can return the `nothing`:
144144
# ChainRules.derivatives_given_output("anything", exp, 1) == (("anything",),)
145145
return isconcretetype(gT) && gT <: Tuple{Tuple{Number}}

0 commit comments

Comments
 (0)