2 ms·
I think one way numerical computation APIs can offer optimizations of this sort is to expose a chaining API. For eg: chain(my_large_array).op1().op2().op3().r
by hannofcart 7y ago
I think one way numerical computation APIs can offer optimizations of this sort is to expose a chaining API.
For eg:
chain(my_large_array).op1().op2().op3().result()
Using this, the chain() start could copy the input data once, but thereafter do a series of in place mutations in op1, op2 and op3 to improve performance.
Do numpy APIs provide such facilities?
- pornel 7y agoRust iterators combine like that if the operations are per-element (iter + map + collect). For optimizing complex access patterns you'd need a language like Halide.