Skip to content

Commit

Permalink
Skipping CUDA tests for CPU setup
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderDokuchaev committed Oct 11, 2023
1 parent da1e175 commit b1536d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 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 @@ -64,10 +65,14 @@ def check_bias(model: NNCFNetwork, ref_bias: list):
class TestTorchCudaFBCAlgorithm(TestTorchFBCAlgorithm):
@staticmethod
def list_to_backend_type(data: List) -> torch.Tensor:
if not torch.cuda.is_available():
pytest.skip("Skipping for CPU-only setups")
return torch.Tensor(data).cuda()

@staticmethod
def backend_specific_model(model: bool, tmp_dir: str):
if not torch.cuda.is_available():
pytest.skip("Skipping for CPU-only setups")
return get_nncf_network(model.cuda(), model.INPUT_SIZE)

@staticmethod
Expand Down

0 comments on commit b1536d2

Please sign in to comment.