You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# see discussion at https://github.com/JuliaDiff/ChainRulesCore.jl/pull/626#discussion_r1345235265
128
-
y =Array{guess_zero_tangent_type(P),N}(undef, size(x)...)
129
+
y =Array{guess_zero_tangent_type(P),N}(undef, size(x)...)
129
130
@inboundsfor n ineachindex(y)
130
131
ifisassigned(x, n)
131
132
y[n] =zero_tangent(x[n])
@@ -135,6 +136,8 @@ function zero_tangent(x::Array{P, N}) where {P, N}
135
136
end
136
137
137
138
guess_zero_tangent_type(::Type{T}) where {T<:Number} = T
138
-
guess_zero_tangent_type(::Type{<:Array{T,N}}) where {T,N} = Array{guess_zero_tangent_type(T), N}
139
+
functionguess_zero_tangent_type(::Type{<:Array{T,N}}) where {T,N}
140
+
return Array{guess_zero_tangent_type(T),N}
141
+
end
139
142
guess_zero_tangent_type(::Any) = Any # if we had a general way to handle determining tangent type # https://github.com/JuliaDiff/ChainRulesCore.jl/issues/634
140
-
#TODO: we might be able to do better than this. even without.
143
+
#TODO: we might be able to do better than this. even without.
0 commit comments