Skip to content

Commit a772728

Browse files
committed
Suppress NumbaPerformanceWarnings
1 parent 64eeee1 commit a772728

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

@@ -24,6 +25,16 @@
2425
from pytensor.typed_list import TypedListType
2526

2627

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

0 commit comments

Comments
 (0)