question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ENH: Create the ability for fused operations (fused ufuncs or `map_reduce`) style

See original GitHub issue

It would be nice to have something in NumPy, which would give the largest value by magnitude. IOW abs(a).max(). However it would be better if it didn’t result in creating a second copy of the data as abs(a) would do.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
eric-wiesercommented, Jul 26, 2018

I don’t like that idea of adding ufuncs for a small subset of op, reduction. If this is a common enough case, perhaps we should support something like np.map_reduce, used as:

max_abs   = np.ufunc.map_reduce(np.abs, np.maximum)
all_equal = np.ufunc.map_reduce(np.equal, np.logical_and)

max_abs(a)       # np.maximum.reduce(np.abs(a)), but more efficient
all_equal(a, b)  # np.logical_and.reduce(np.equal(a, b)), but more efficient

could possibly be maintained in its own package!

That seems reasonable to me - anyone is free to create their own gufunc that does these things

0reactions
charriscommented, Aug 17, 2018

How does scikit-learn handle signed integers?

Read more comments on GitHub >

github_iconTop Results From Across the Web

interfaces for efficient software composition on modern ...
compiler-style optimizations such as loop fusion, common subexpression elimination, and code generation in programs that combine many such functions.
Read more >
Automatic parallelization with @jit - Numba
With auto-parallelization, all operations that produce array of size N are fused together to become a single parallel kernel. This includes the inner...
Read more >
Software Modules on the Grace Cluster
'FuSeq is a novel method to discover fusion genes from paired-end RNA sequencing data.' futhark, 'Futhark is a small programming language ...
Read more >
Apropos rat - FreeBSD
... library for password database operations in capability mode ... xo_error(3): generate simple error messages in multiple output styles; xo_set_flags(3), ...
Read more >
Jacob, Dejice (2020) Opportunistic acceleration of array ...
loop fusion and loop fission allow code optimisation for various parameters like number of ... programming style, perhaps skewed to the scientific domain....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found