Things like negation and addition are often not broadcast as they have the same result and often performance as broadcasting in base Julia.
So things like:
x .= -y + z
x .= -y .+ z
x .= .-y .+ z
all give the same result, but only the last one gets all the way fused in our current implementation. We can implement + and unary - to return Broadcasted objects potentially to guarantee that these things lower to fusion. Some potential correctness issues. Like -y + z should actually materialize the broadcasted expression and return an NDArray as thats what Julia would do.
For now we should just document users to use @. to guarantee fusion.
Things like negation and addition are often not broadcast as they have the same result and often performance as broadcasting in base Julia.
So things like:
all give the same result, but only the last one gets all the way fused in our current implementation. We can implement
+and unary-to returnBroadcastedobjects potentially to guarantee that these things lower to fusion. Some potential correctness issues. Like-y + zshould actually materialize the broadcasted expression and return anNDArrayas thats what Julia would do.For now we should just document users to use
@.to guarantee fusion.