[Numpy-discussion] np.dot and 'out' bug

Nathaniel Smith njs at pobox.com
Thu May 23 10:42:37 EDT 2013

On Thu, May 23, 2013 at 3:19 PM, Matthieu Brucher
<matthieu.brucher at gmail.com> wrote:
> Hi,
> It's to be expected. You are overwritten one of your input vector while it
> is still being used.
> So not a numpy bug ;)

Sure, that's clearly what's going on, but numpy shouldn't let you
silently shoot yourself in the foot like that. Re-using input as
output is a very common operation, and usually supported fine.
Probably we should silently make a copy of any input(s) that overlap
with the output? For high-dimensional dot, buffering temprary
subspaces would still be more memory efficient than anything users
could reasonably accomplish by hand.


More information about the NumPy-Discussion mailing list