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
14 changes: 14 additions & 0 deletions brainscore_vision/benchmarks/kar2019/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,22 @@
from brainscore_vision.benchmarks.kar2019 import DicarloKar2019OST
from brainscore_core.supported_data_standards.brainio import s3


def _cuda_available() -> bool:
try:
import torch
return torch.cuda.is_available()
except ImportError:
return False


requires_cuda = pytest.mark.skipif(not _cuda_available(), reason="CUDA not available")

visual_degrees = VisualDegreesTests()
number_trials = NumberOfTrialsTests()


@requires_cuda
@pytest.mark.memory_intense
@pytest.mark.private_access
@pytest.mark.slow
Expand Down Expand Up @@ -51,6 +63,7 @@ def test_repetitions():
number_trials.repetitions_test('Kar2019-ost')


@requires_cuda
@pytest.mark.memory_intense
@pytest.mark.private_access
def test_no_time():
Expand All @@ -73,6 +86,7 @@ def test_no_time():
assert score.attrs['ceiling'] == approx(.79)


@requires_cuda
@pytest.mark.memory_intense
@pytest.mark.private_access
def test_random_time():
Expand Down
Loading