Skip to content

Commit 8a056db

Browse files
committed
filter numpy warnings
1 parent c831d11 commit 8a056db

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

requirements/pytorch/check-avail-extras.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1+
import sys
2+
import warnings
3+
14
if __name__ == "__main__":
5+
if sys.platform == "win32":
6+
# ignore warnings related to Python 3.13 and Numpy incompatibility on Windows
7+
numpy_warnings = [
8+
r"invalid value encountered in exp2.*",
9+
r"invalid value encountered in nextafter.*",
10+
r"invalid value encountered in log10.*",
11+
]
12+
13+
for w in numpy_warnings:
14+
warnings.filterwarnings(
15+
action="ignore",
16+
message=w,
17+
category=RuntimeWarning,
18+
)
19+
220
import hydra # noqa: F401
321
import jsonargparse # noqa: F401
422
import matplotlib # noqa: F401

0 commit comments

Comments
 (0)