Skip to content

Commit

Permalink
Try using the CI variable instead
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorTatarnikov committed May 30, 2024
1 parent 9a70828 commit 9b1b050
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import sys

import pytest
import torch
Expand All @@ -19,10 +18,11 @@ def set_device_arm_macos_ci():
GitHub runners. This is to avoid the following error:
https://discuss.pytorch.org/t/mps-back-end-out-of-memory-on-github-action/189773/5
"""
if sys.platform == "darwin" and torch.backends.mps.is_available():
if os.getenv("CI") == "true" and torch.backends.mps.is_available():
import keras

Check warning on line 22 in tests/conftest.py

View check run for this annotation

Codecov / codecov/patch

tests/conftest.py#L22

Added line #L22 was not covered by tests

keras.src.backend.common.global_state.set_global_attribute(

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
"torch_device", "cpu"
)

# force_cpu()

0 comments on commit 9b1b050

Please sign in to comment.