Hi Manoj,

For efficiency, the BLAS api defines different functions for different 
underlying datatypes (float32, float64, complex64, complex128). The 
scipy "get_blas_funcs" utility has the role of getting the Python 
wrapper for the given BLAS functions (in this case 'swap' and 'nrm2', 
that's appropriate for the given data (in this case, 'X').

However since BLAS is strictly for dense linear algebra, it doesn't 
make sense to pass in sparse matrices even to this function.  This is 
kind of natural as you wouldn't be able to use 'swap' and 'nrm2' on 
that X anyway.

I'm not familiar with the code. If you plan to use those BLAS functions 
of some dense smaller arrays derived from X, then I think you can 
replace that line by passing the dtype=X.dtype parameter instead of the 
arrays=(X,) parameter (cf. get_blas_funcs signature).
If it turns out that swap and nrm2 are not useful in the sparse case, 
then you don't need to get them anyway. It all depends how your 
implementation will be structured and whether the dense and sparse case 
can share code at all (which is not always possible).

HTH,
Vlad

On Tue Mar 18 19:56:11 2014, Manoj Kumar wrote:
> Hello,
>
> I am trying to add support for sparse matrices in RandomizedLasso. I'm
> stuck at this line.
>
> swap, nrm2 = linalg.get_blas_funcs(('swap', 'nrm2'), (X,))
>
> When X is sparse. this fails with the following error.
>
> AttributeError, flags not found.
>
> Is this expected behaviour?
>
> Any help would be greatly appreciated.
>
> --
> Regards,
> Manoj Kumar,
> Mech Undergrad
> http://manojbits.wordpress.com
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
>
>
> _______________________________________________
> Scikit-learn-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to