Closed
Description
Describe the issue:
The title sums it up, let's let the code do the talking :)
Reproduce the code example:
On an ARM64 machine running Ubuntu 20.04:
Python 3.10.8 (main, Oct 18 2022, 11:26:55) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.machine()
'aarch64'
>>> import numpy as np
>>> np.__version__
'1.23.4'
>>> array = np.array([np.nan, np.nan, np.nan], dtype=np.float64)
>>> np.cos(array)
array([nan, nan, nan])
>>> np.cos(array.astype(np.float32))
<stdin>:1: RuntimeWarning: invalid value encountered in cos
array([nan, nan, nan], dtype=float32)
>>> np.seterr()
{'divide': 'warn', 'over': 'warn', 'under': 'ignore', 'invalid': 'warn'}
>>>
On an Intel machine running Ubuntu 22.04:
ython 3.10.8 (main, Oct 12 2022, 12:54:48) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.machine()
'x86_64'
>>> import numpy as np
>>> np.__version__
'1.23.4'
>>> array = np.array([np.nan, np.nan, np.nan], dtype=np.float64)
>>> np.cos(array)
array([nan, nan, nan])
>>> np.cos(array.astype(np.float32))
array([nan, nan, nan], dtype=float32)
>>> np.seterr()
{'divide': 'warn', 'over': 'warn', 'under': 'ignore', 'invalid': 'warn'}
>>>
Error message:
No response
NumPy/Python version information:
Python: 3.10.8
Numpy: 1.23.4
$ poetry run python -c "import numpy; numpy.show_config()"
<snip blas stuff (@seberg)>
Supported SIMD extensions in this NumPy install:
baseline = NEON,NEON_FP16,NEON_VFPV4,ASIMD
found = ASIMDHP
not found = ASIMDDP,ASIMDFHM
Context for the issue:
I develop on an Intel machine, but deploy to ARM machines, and this makes things tricky 😄