File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,13 @@ function rrule(
3737 return Base. vect (X... ), vect_pullback
3838end
3939
40- # This rule isn't certain to be correct, if someone has overloaded `Base.vect` for their type
41- # in a way that has a non-identity derivative; but that is a very weird thing to do.
42- # so we are confident that this is safe.
43- # Zygote and Diffractor fall over completely without this rule.
40+ # This rule isn't certain to be correct.
41+ # This rule _is_ correct when elements of `X` pass straight through into the output without
42+ # modification. e.g. if the output type of `vect` is a `Vector{Any}`, then this should be
43+ # correct. If, however, the type of some elements of `X` change in this operation in such a
44+ # way that their cotangents require projection on the reverse pass of AD, this projection
45+ # won't happen, possibly causing problems later on in the reverse pass.
46+ # Zygote and Diffractor fall over completely without this rule.
4447function rrule (:: typeof (Base. vect), X:: Vararg{Any,N} ) where {N}
4548 vect_pullback (ȳ) = (NoTangent (), ntuple (n -> ȳ[n], N)... )
4649 return Base. vect (X... ), vect_pullback
You can’t perform that action at this time.
0 commit comments