MCPcopy Index your code
hub / github.com/numpy/numpy / blas_fpe_check

Function blas_fpe_check

numpy/__init__.py:850–869  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

848 del _mac_os_check
849
850 def blas_fpe_check():
851 if sys.platform != "darwin":
852 # We currently assume this is limited to MacOS as downstream NumPy
853 # import during dlopen caused a deadlock regression: gh-31284
854 return
855
856 # Check if BLAS adds spurious FPEs, seen on M4 arms with Accelerate.
857 # In this case we disable FPE reporting since the use of SME poisons
858 # it and Accelerate doesn't sanitize them.
859 with errstate(all='raise'):
860 x = ones((20, 20))
861 try:
862 x @ x
863 except FloatingPointError:
864 res = _core._multiarray_umath._blas_supports_fpe(False)
865 if res: # res was not modified (hardcoded to True for now)
866 warnings.warn(
867 "Spurious warnings given by blas but suppression not "
868 "set up on this platform. Please open a NumPy issue.",
869 UserWarning, stacklevel=2)
870
871 blas_fpe_check()
872 del blas_fpe_check

Callers 1

__init__.pyFile · 0.85

Calls 2

errstateClass · 0.85
onesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…