Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipping CUDA tests for CPU setup #2191

Merged
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions tests/torch/ptq/test_fast_bias_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

from typing import List

import pytest
import torch

from nncf.common.factory import NNCFGraphFactory
Expand Down Expand Up @@ -61,6 +62,7 @@ def check_bias(model: NNCFNetwork, ref_bias: list):
raise ValueError("Not found node with bias")


@pytest.mark.skipif(not torch.cuda.is_available(), reason="Skipping for CPU-only setups")
class TestTorchCudaFBCAlgorithm(TestTorchFBCAlgorithm):
@staticmethod
def list_to_backend_type(data: List) -> torch.Tensor:
Expand Down
3 changes: 1 addition & 2 deletions tests/torch/test_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ def to_tensor(x):
return torch.tensor(x)


@pytest.mark.skipif(not torch.cuda.is_available(), reason="Skipping for CPU-only setups")
class TestCudaPTNNCFTensorOperators(TemplateTestNNCFTensorOperators):
@staticmethod
def to_tensor(x):
if not torch.cuda.is_available():
pytest.skip("Skipping for CPU-only setups")
return torch.tensor(x).cuda()

def test_device(self):
Expand Down