nerf-pytorch/torchsearchsorted/test/conftest.py

12 lines
251 B
Python
Raw Normal View History

2020-03-20 00:43:48 +01:00
import pytest
import torch
devices = {'cpu': torch.device('cpu')}
if torch.cuda.is_available():
devices['cuda'] = torch.device('cuda:0')
@pytest.fixture(params=devices.values(), ids=devices.keys())
def device(request):
return request.param