3 ms·
My experience finds that the in-place optimization can indeed speed up numpy code. Even if you're not memory constrained, fewer arrays in play means less memory
by kardos 7y ago
My experience finds that the in-place optimization can indeed speed up numpy code. Even if you're not memory constrained, fewer arrays in play means less memory bandwidth needed.
>> Many NumPy APIs include an out keyword argument, allowing you to write the results to an existing array, often including the original one.
I'd wager that saving memory or memory bandwidth is the impetus for expanding the API to include this option.