Skip to content

Commit bc57832

Browse files
staticfloatoxinabox
authored andcommitted
Avoid lowering to Base.rest(), as it infers poorly
While it would be best to fix `Base.rest()` to be able to infer properly, at the moment the destructuring with a splat in the arguments to this `frule` end up causing inference issues in Diffractor.
1 parent 9dc2d7f commit bc57832

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/rulesets/Base/fastmath_able.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ let
169169
@scalar_rule x / y (one(x) / y, -/ y))
170170

171171
## many-arg +
172-
function frule((_, Δx, Δy...), ::typeof(+), x::Number, ys::Number...)
173-
+(x, ys...), +(Δx, Δy...)
172+
function frule(Δs, ::typeof(+), x::Number, ys::Number...)
173+
+(x, ys...), +(Base.tail(Δs)...)
174174
end
175175

176176
function rrule(::typeof(+), x::Number, ys::Number...)

0 commit comments

Comments
 (0)