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
124
-
y =Array{guess_zero_tangent_type(P),N}(undef, size(x)...)
125
+
y =Array{guess_zero_tangent_type(P),N}(undef, size(x)...)
125
126
@inboundsfor n ineachindex(y)
126
127
ifisassigned(x, n)
127
128
y[n] =zero_tangent(x[n])
@@ -131,6 +132,8 @@ function zero_tangent(x::Array{P, N}) where {P, N}
131
132
end
132
133
133
134
guess_zero_tangent_type(::Type{T}) where {T<:Number} = T
134
-
guess_zero_tangent_type(::Type{<:Array{T,N}}) where {T,N} = Array{guess_zero_tangent_type(T), N}
135
+
functionguess_zero_tangent_type(::Type{<:Array{T,N}}) where {T,N}
136
+
return Array{guess_zero_tangent_type(T),N}
137
+
end
135
138
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
136
-
#TODO: we might be able to do better than this. even without.
139
+
#TODO: we might be able to do better than this. even without.
0 commit comments