[Numpy-discussion] svd error checking vs. speed

Jason Grout jason-sage at creativetrax.com
Mon Feb 17 09:58:24 EST 2014

On 2/15/14 3:37 PM, alex wrote:
> The proposal would be to make np.linalg.svd more like scipy.linalg.svd
> with respect to input checking.  The argument against the change is
> raw speed; if you know that you will never feed non-finite input to
> svd, then np.linalg.svd is a bit faster than scipy.linalg.svd.  An
> argument for the change could be to avoid issues reported on github
> like crashes, hangs, spurious non-convergence exceptions, etc. from
> the undefined behavior of svd of non-finite input.

For what my vote is worth, -1.  I thought this was pretty much the 
designed difference between the scipy and numpy linalg routines.  Scipy 
does the checking, and numpy provides the raw speed.  Maybe this is 
better resolved as a note in the documentation for numpy about the 
assumptions for the input and a reference to the scipy implementation?

That said, I don't extensively use the linalg.svd routine in practice, 
so I defer to those that use it.



More information about the NumPy-Discussion mailing list