Skip to content

Commit ef149a1

Browse files
committed
Suppress NumbaPerformanceWarnings
1 parent 63d1506 commit ef149a1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pytensor/link/numba/dispatch/basic.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import numba
77
import numpy as np
8+
from numba import NumbaPerformanceWarning
89
from numba import njit as _njit
910
from numba.cpython.unsafe.tuple import tuple_setitem # noqa: F401
1011

@@ -23,6 +24,16 @@
2324
from pytensor.tensor.utils import hash_from_ndarray
2425

2526

27+
# Disable loud / incorrect warnings from Numba
28+
# https://github.com/numba/numba/issues/10086
29+
# TODO: Would be much better if we could disable only for our functions
30+
warnings.filterwarnings(
31+
"ignore",
32+
message="is faster on contiguous arrays",
33+
category=NumbaPerformanceWarning,
34+
)
35+
36+
2637
def numba_njit(
2738
*args, fastmath=None, final_function: bool = False, **kwargs
2839
) -> Callable:

0 commit comments

Comments
 (0)