-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
foldsum, maximum, reduce, foldl, etc.sum, maximum, reduce, foldl, etc.performanceMust go fasterMust go faster
Description
We should extend #21672
for all iterators, in so far as is possible.
That way people would not run into surprises
when they do reduce(hcat, filter(x->x[1]>5, xs))
or reduce(vcat, (vec(sum(abs2, xs; dim=2)) for x in xs) etc
Because right now the performance of those kind of things is worse than splatting.
and it is really annoying having to be so careful about your types when writing code.
Likely any PR to solve this would also solve #31169
just because that one makes writing tests for correctness of behavior annoying
Fixing this for generators
would allow solving the mapreduce(vcat/hcat problem in #31137
(and its generalization to nonarrays,)
since
we could have mapreduce(f, vcat, xs) = reduce(vcat, f(x) for x in xs)
yurivish, nickrobinson251, chriscoey, briochemc, nlw0 and 7 more
Metadata
Metadata
Assignees
Labels
foldsum, maximum, reduce, foldl, etc.sum, maximum, reduce, foldl, etc.performanceMust go fasterMust go faster