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

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


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 ;)

Matthieu


2013/5/23 Pierre Haessig <pierre.haessig at crans.org>

> Hi Nicolas,
>
> Le 23/05/2013 15:45, Nicolas Rougier a écrit :
> > if I use either a or b as output, results are wrong (and nothing in the
> dot documentation prevents me from doing this):
> >
> > a = np.array([[1, 2], [3, 4]])
> > b = np.array([[1, 2], [3, 4]])
> > np.dot(a,b,out=a)
> >
> > -> array([[ 6, 20],
> >           [15, 46]])
> >
> >
> > Can anyone confirm this behavior ? (tested using numpy 1.7.1)
> I just reproduced the same weird results with numpy 1.6.2
>
> best,
> Pierre
>
>
> _______________________________________________
> 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/91e1f866/attachment.html>


More information about the NumPy-Discussion mailing list