viennacl / pyviennacl-dev

Developer repository for PyViennaCL. Visit http://viennacl.sourceforge.net/ for latest releases.
MIT License
32 stars 6 forks source link

Weird resizing issue with element_prod #31

Open mortonjt opened 9 years ago

mortonjt commented 9 years ago

I've noticed unexpected resizing when I'm doing element wise multiplication When I run the following code

import pyviennacl as pv
import numpy as np
a = pv.Matrix(np.array([ [1,2,3], [4,5,6] ], dtype=np.float32))
a.element_prod(a)

This is the output

array([[  1.,   4.,   9.],
       [ 16.,  25.,  36.],
       [  0.,   0.,   0.]], dtype=float32)

The workaround I'm going to use for now is to subset the result matrix. However, from previous experience, I know that this subsetting operation is costly

Note: I am running into this issue with the pip installable version. Has this been fixed in a more recent update? If not, is there are preferred work around solution?

tsmithe commented 9 years ago

Ah, yes, that does look like a bug. I'll make sure it is fixed in the git repo.

I have been saying this for a while, but I really do intend to get a new release out soon. I've had to do a lot of travelling over the last few weeks, but once I settle down again, the new release is my top priority (after my day job..).

tsmithe commented 9 years ago

As for an easy workaround, I will try and think of one at the same time as investigating the status of this in git master in the next couple of days.

robclouth commented 8 years ago

Hey, same issue. Any updates on this? I'm using the pip install version.

karlrupp commented 8 years ago

@tsmithe Any chance you can have a look at this? It's probably easy for you to fix. ;-)