Skip to content

Commit

Permalink
Use force_cpu function from cellfinder
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorTatarnikov committed May 31, 2024
1 parent 066fbd9 commit 0ab452a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,7 @@ commands =
description =
Run tests
coredev: Run tests with the development version of cellfinder
passenv = GITHUB_*
passenv =
CI
GITHUB_*
"""
11 changes: 2 additions & 9 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

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 @@ -22,10 +21,4 @@ def set_device_arm_macos_ci():
os.getenv("GITHUB_ACTIONS") == "true"
and torch.backends.mps.is_available()
):
import keras

keras.src.backend.common.global_state.set_global_attribute(
"torch_device", "cpu"
)

# force_cpu()
force_cpu()

Check warning on line 24 in tests/conftest.py

View check run for this annotation

Codecov / codecov/patch

tests/conftest.py#L24

Added line #L24 was not covered by tests

0 comments on commit 0ab452a

Please sign in to comment.