Skip to content

Commit 01aed6c

Browse files
committed
delete commented lines
1 parent 164b257 commit 01aed6c

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/extra_rules.jl

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,6 @@ end
181181

182182
@ChainRulesCore.non_differentiable StaticArrays.promote_tuple_eltype(T)
183183

184-
# 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-
189184
function ChainRules.rrule(::DiffractorRuleConfig, ::typeof(map), ::typeof(+), A::AbstractArray, B::AbstractArray)
190185
map(+, A, B), Δ->(NoTangent(), NoTangent(), Δ, Δ)
191186
end
@@ -220,7 +215,7 @@ struct BackMap{T}
220215
f::T
221216
end
222217
(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
224219
back_apply_zero(x) = x(Zero()) # Zero is not defined
225220

226221
function ChainRules.rrule(::DiffractorRuleConfig, ::typeof(map), f, args::Tuple)
@@ -230,10 +225,6 @@ function ChainRules.rrule(::DiffractorRuleConfig, ::typeof(map), f, args::Tuple)
230225
(NoTangent(), sum(fs), xs)
231226
end
232227
map_back::AbstractZero) = (NoTangent(), NoTangent(), NoTangent())
233-
# function back(Δ::ZeroTangent)
234-
# (fs, xs) = unzip_tuple(map(back_apply_zero, b))
235-
# (NoTangent(), sum(fs), xs)
236-
# end
237228
a, map_back
238229
end
239230

0 commit comments

Comments
 (0)