[pythran] Re: Matrix multiplication in Pythran

  • From: Joel FALCOU <joel.falcou@xxxxxxxxx>
  • To: pythran@xxxxxxxxxxxxx
  • Date: Wed, 25 Mar 2015 19:44:06 +0100

Pierrick, we need to see if you can't just leverage our protable BLAS
wrapper from NT2 directly.

On 25/03/2015 19:31, Pierrick Brunet wrote:
> Hi Valerio,
> 
> It is great to see Pythran used that way and thanks for these kind of
> feed back.
> 
> About numpy.dot, only the vec * vec implementation exists for now but it
> is planned to add this with the numpy.linalg package.
> 
> To get around this problem, we will be really happy if you want to add
> this implementation in Pythran :-)
> Otherwise, I may have a look at this tomorrow for, at least, a "slow"
> implementation for compatibility.
> If you want to test it now. I suggest you to implement this function in
> you Python module (using Python) and Pythran will convert it for you.
> 
> Cheers,
> Pierrick
> 
> On 25/03/2015 19:10, Valerio De Carolis wrote:
>> Dear Serge,
>>
>> I'm using Pythran since a while and used for several research projects.
>>
>> Now I was trying to update a bigger project under pythran but I'm
>> getting several errors as soon as I encounter matrix multiplications.
>>
>> As you know NumPy is quite messy with the semantics so I'll write an
>> example:
>>
>>> import numpy as np
>>>
>>> #pythran export test_func(float[][], float[])
>>> def test_func(A, b):
>>>     return np.dot(A, b)
>>
>> This is supposed to be the product among a 2-dim ndarray and a 1-dim
>> ndarray, the classical (N x M) * (M x 1) multiplication case that
>> other fellow researchers used in their numpy code.
>>
>> Now this is failing to compile because there is no such implementation
>> in the dot.hpp file.
>>
>> Do you know if such feature is planned or if there is a way of getting
>> around this problem? I also tried casting to the numpy.matrix() type
>> but I've seen the repo code that is still a missing feature.
>>
>> Thanks for the help.
>>
>> Cheers,
>> Valerio
>>
>>
>>
> 
> 

Other related posts: