Skip to content

Commit 3d47cd8

Browse files
authored
Merge pull request #1627 from A-Dawn/feature/a-memorix-disabled-by-default
fix:更正默认值,避免意料之外的内存占用
2 parents 554e5fd + 96557bd commit 3d47cd8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from __future__ import annotations
2+
3+
import os
4+
5+
6+
_NATIVE_THREAD_ENV_DEFAULTS = {
7+
"OMP_NUM_THREADS": "1",
8+
"OPENBLAS_NUM_THREADS": "1",
9+
"MKL_NUM_THREADS": "1",
10+
"NUMEXPR_NUM_THREADS": "1",
11+
}
12+
13+
for _name, _value in _NATIVE_THREAD_ENV_DEFAULTS.items():
14+
os.environ.setdefault(_name, _value)

0 commit comments

Comments
 (0)