Avoid fully patching torch on M1 macs

This commit is contained in:
Matthias
2024-03-09 17:55:22 +01:00
parent 29f90cbd04
commit cc3b2000eb
2 changed files with 8 additions and 9 deletions
+6 -1
View File
@@ -25,10 +25,15 @@ def is_mac() -> bool:
return "Darwin" in machine
def is_arm() -> bool:
machine = platform.machine()
return "arm" in machine or "aarch64" in machine
@pytest.fixture(autouse=True)
def patch_torch_initlogs(mocker) -> None:
if is_mac():
if is_mac() and not is_arm():
# Mock torch import completely
import sys
import types