[Numpy-discussion] numarray bug: dot product between 2x2 and 3x2x3 on Mac different from PC

Todd Miller jmiller at stsci.edu
Tue Jul 18 18:37:06 EDT 2006


Sebastian Haase wrote:
> OK - understood.  Combining int32 with float64 proves to be less 
> cumbersome ...
>   
> Why are numarray and numpy giving different answers ?
>   
I have a little insight as to what is going on here but no fix.   
numarray has two versions of dot():

1. The original dot() is standalone, easy to install, and basically 
works.   This dot() does however have the type coercion wart where Int32 
dotted with Float32 silently loses precision.   

2. A more optimized dot(), ported from Numeric,   depends on an external 
BLAS.  This makes it faster but also generally harder to install.  This 
optimized dot() has the higher dimensional array bug you discovered.   
For arrays of rank > 2,  it's totally broken.  Since Mac OS-X has a 
standard BLAS,  it uses the optimized dot() by default and exposes the 
bug.   The optimized dot() is easy to turn off in cfg_packages.py by 
commenting out the lines:

# if os.path.exists('/System/Library/Frameworks/vecLib.framework'):
#         USE_LAPACK = True

Since numarray is being phased out and neither issue is a serious 
problem for STScI,  we're not planning to fix them.   If it's causing 
someone major hardship let us know and we'll reconsider.

Todd




More information about the NumPy-Discussion mailing list