logoalt Hacker News

sigbottletoday at 7:18 PM1 replyview on HN

It always messes with me: reducing across a specific axis always takes O(whole tensor) time, because there's no difference between "iterate over all dims, then collapse the final one" versus "iterate versus the first dim and do some cursed tensor accum" (and likewise for between)

Maybe there's just a better way to think about it and I'm still thinking about it way too much like a programmer


Replies

bjournetoday at 8:16 PM

No, reduce has exactly the same time complexity as map and filter.

show 1 reply