[Numpy-discussion] return type diffences of indexed arrays with Intel C++ compiler (Python 2.5)
Travis Oliphant
oliphant at ee.byu.edu
Mon Oct 2 16:53:08 CDT 2006
Lars Bittrich wrote:
>Hi all,
>
>recently I tried to compile numpy/scipy with Python 2.5 and Intel C++ compiler
>9.1. At first everything was fine, but the scipy test produced a few errors.
>The reason was a little difference:
>
>numpy svn(1.0.dev3233) with Intel C compiler (Python 2.5):
>-----------------------------------------------------------
>In [1]:from numpy import ones, zeros, integer
>
>In [2]:
>
>In [2]:x = ones(1)
>
>In [3]:i = zeros(1, integer)
>
>In [4]:x[i]
>Out[4]:1.0
>
>numpy svn(1.0.dev3233) with GCC 3.3 (Python 2.3):
>--------------------------------------------------
>In [1]:from numpy import ones, zeros, integer
>
>In [2]:
>
>In [2]:x = ones(1)
>
>In [3]:i = zeros(1, integer)
>
>In [4]:print x[i]
>Out[4]:array([1])
>
>The Intel version gives me a scalar whereas the gcc version an array. Maybe
>Python 2.5 is causing this problem but my first guess was the compiler.
>
>
>
This is a Python 2.5 issue (the new __index__ method) was incorrectly
implemented and allowing a 1-d array to be interpreted as an index.
This should be fixed in SVN.
-Travis
More information about the Numpy-discussion
mailing list