Skip to content

Commit

Permalink
Go back to setting keras global state in brainglobe-workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorTatarnikov committed May 30, 2024
1 parent 519c7c6 commit 31331b7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import os

import keras
import pytest
import torch
from cellfinder.core.tools.system import force_cpu

# from cellfinder.core.tools.system import force_cpu


@pytest.fixture(scope="session", autouse=True)
Expand All @@ -16,4 +18,7 @@ def set_device_arm_macos_ci():
os.getenv("GITHUB_ACTIONS") == "true"
and torch.backends.mps.is_available()
):
force_cpu()
keras.src.backend.common.global_state.set_global_attribute(
"torch_device", "cpu"
)
# force_cpu()

0 comments on commit 31331b7

Please sign in to comment.