Got it. Yes, I’m very interested in this, too. How natural op(xs...) == reduce(op, xs) really is? If we implement optimization for op(...f.(xs)) (or another syntax), are people going to use it? Is it less “scary” and more intuitive than reduce?
Isn’t it enough to lower op(...f.(xs)) to reduce(op, broadcasted(f, xs)) so that broadcasting and reduction are fused? Can we do more than this?
Right: the reduction syntax acts as a barrier for broadcast and removes the call to materialize. I’m not sure anything else is required. We already discussed the dims keyword on the issue and it seemed clear that was an orthogonal problem.
No, it’s because there is an optimised version of reduce(hcat, a), but reduce(vcat, a') goes to the fallback routine since a' is not an AbstractVector.
Hi @WinterTheJellyfish, welcome to the community!
Please refrain from ressuscitating very old topics, this needlessly pings everyone who was involved in the conversation half a decade ago.
By the way, the modern answer to this question is probably the stack function