Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions pytests/test_torchoperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from numpy.testing import assert_array_equal

backend = "numpy"
import numpy as npp
import pytest
import torch

Expand All @@ -33,7 +32,7 @@ def test_TorchOperator(par):
# temporarily, skip tests on mac as torch seems not to recognized
# numpy when v2 is installed
if platform.system() == "Darwin":
return
pytest.skip("torch not recognized on macOS with numpy v2")
device = "cpu" if backend == "numpy" else "cuda"

Dop = MatrixMult(np.random.normal(0.0, 1.0, (par["ny"], par["nx"])))
Expand Down Expand Up @@ -63,7 +62,7 @@ def test_TorchOperator_batch(par):
# temporarily, skip tests on mac as torch seems not to recognized
# numpy when v2 is installed
if platform.system() == "Darwin":
return
pytest.skip("torch not recognized on macOS with numpy v2")
device = "cpu" if backend == "numpy" else "cuda"

Dop = MatrixMult(np.random.normal(0.0, 1.0, (par["ny"], par["nx"])))
Expand All @@ -85,7 +84,7 @@ def test_TorchOperator_batch_nd(par):
# temporarily, skip tests on mac as torch seems not to recognized
# numpy when v2 is installed
if platform.system() == "Darwin":
return
pytest.skip("torch not recognized on macOS with numpy v2")
device = "cpu" if backend == "numpy" else "cuda"

Dop = MatrixMult(np.random.normal(0.0, 1.0, (par["ny"], par["nx"])), otherdims=(2,))
Expand Down