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

Matthieu Brucher matthieu.brucher at gmail.com
Thu May 23 10:57:08 EDT 2013


In my point of view, you should never use an output argument equal to an
input argument. It can impede a lot of optimizations.

Matthieu


2013/5/23 Nicolas Rougier <Nicolas.Rougier at inria.fr>

>
> >
> > 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.
>
>
>
> Also, from a user point of view it is difficult to sort out which
> functions currently allow 'out=a' or  out=b' since nothing in the 'dot'
> documentation warned me about such problem.
>
>
> Nicolas
>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
Information System Engineer, Ph.D.
Blog: http://matt.eifelle.com
LinkedIn: http://www.linkedin.com/in/matthieubrucher
Music band: http://liliejay.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130523/e1e61182/attachment.html>


More information about the NumPy-Discussion mailing list