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
pairs = ()
pairs = (pairs..., :(@. x +=1))
for i in1:2
pairs = (pairs..., :(@. x +=2))
pairs = (pairs..., :(@. x +=3))
endend
But this is type-unstable because the type of pairs changes across the loop. We could instead lower this to:
pairs = ()
pairs = (pairs..., :(@. x +=1))
pairs = (pairs..., Iterators.flatmap(1:2) do i
(:(@. x +=2), :(@. x +=3))
endend
which the compiler may have a chance at inferring.
One consideration is: what if we have if-blocks inside? It should work with Union-splitting, but this approach might be problematic if there are runtime checks.
The text was updated successfully, but these errors were encountered:
Right now,
fused_assemble
generates code like:But this is type-unstable because the type of
pairs
changes across the loop. We could instead lower this to:which the compiler may have a chance at inferring.
One consideration is: what if we have
if
-blocks inside? It should work with Union-splitting, but this approach might be problematic if there are runtime checks.The text was updated successfully, but these errors were encountered: