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
# function ChainRules.frule((_, ∂A), ::typeof(getindex), A::AbstractArray, args...)
185
-
# getindex(A, args...), getindex(∂A, args...)
186
-
# end
187
-
# WARNING: Method definition frule(Any, typeof(Base.getindex), AbstractArray{T, N} where N where T, Any...) in module ChainRules at /Users/me/.julia/packages/ChainRules/KVV0e/src/rulesets/Base/indexing.jl:59 overwritten in module Diffractor at /Users/me/.julia/dev/Diffractor/src/extra_rules.jl:184
188
-
189
184
function ChainRules.rrule(::DiffractorRuleConfig, ::typeof(map), ::typeof(+), A::AbstractArray, B::AbstractArray)
190
185
map(+, A, B), Δ->(NoTangent(), NoTangent(), Δ, Δ)
191
186
end
@@ -220,7 +215,7 @@ struct BackMap{T}
220
215
f::T
221
216
end
222
217
(f::BackMap{N})(args...) where {N} =∂⃖¹(getfield(f, :f), args...)
223
-
back_apply(x, y) =x(y)
218
+
back_apply(x, y) =x(y)# this is just |> with arguments reversed
224
219
back_apply_zero(x) =x(Zero()) # Zero is not defined
225
220
226
221
function ChainRules.rrule(::DiffractorRuleConfig, ::typeof(map), f, args::Tuple)
@@ -230,10 +225,6 @@ function ChainRules.rrule(::DiffractorRuleConfig, ::typeof(map), f, args::Tuple)
0 commit comments