"tests/test_layers_utils.py" did not exist on "5e6f50003857860d900612adf44266b9e2e726c8"
Commit 4ce1c05f authored by rusty1s's avatar rusty1s
Browse files

dont cover gpu tests

parent 952a4cad
...@@ -34,7 +34,7 @@ def test_spline_basis_cpu(tensor, i): ...@@ -34,7 +34,7 @@ def test_spline_basis_cpu(tensor, i):
@pytest.mark.skipif(not torch.cuda.is_available(), reason='no CUDA') @pytest.mark.skipif(not torch.cuda.is_available(), reason='no CUDA')
@pytest.mark.parametrize('tensor,i', product(tensors, range(len(data)))) @pytest.mark.parametrize('tensor,i', product(tensors, range(len(data))))
def test_spline_basis_gpu(tensor, i): def test_spline_basis_gpu(tensor, i): # pragma: no cover
degree = data[i].get('degree') degree = data[i].get('degree')
pseudo = Tensor(tensor, data[i]['pseudo']).cuda() pseudo = Tensor(tensor, data[i]['pseudo']).cuda()
pseudo = pseudo.unsqueeze(-1) if pseudo.dim() == 1 else pseudo pseudo = pseudo.unsqueeze(-1) if pseudo.dim() == 1 else pseudo
......
...@@ -69,7 +69,7 @@ def test_spline_weighting_backward_cpu(): ...@@ -69,7 +69,7 @@ def test_spline_weighting_backward_cpu():
@pytest.mark.skipif(not torch.cuda.is_available(), reason='no CUDA') @pytest.mark.skipif(not torch.cuda.is_available(), reason='no CUDA')
@pytest.mark.parametrize('tensor', tensors) @pytest.mark.parametrize('tensor', tensors)
def test_spline_conv_gpu(tensor): def test_spline_conv_gpu(tensor): # pragma: no cover
x = Tensor(tensor, [[9, 10], [1, 2], [3, 4], [5, 6], [7, 8]]) x = Tensor(tensor, [[9, 10], [1, 2], [3, 4], [5, 6], [7, 8]])
edge_index = torch.LongTensor([[0, 0, 0, 0], [1, 2, 3, 4]]) edge_index = torch.LongTensor([[0, 0, 0, 0], [1, 2, 3, 4]])
pseudo = [[0.25, 0.125], [0.25, 0.375], [0.75, 0.625], [0.75, 0.875]] pseudo = [[0.25, 0.125], [0.25, 0.375], [0.75, 0.625], [0.75, 0.875]]
...@@ -92,9 +92,17 @@ def test_spline_conv_gpu(tensor): ...@@ -92,9 +92,17 @@ def test_spline_conv_gpu(tensor):
is_open_spline, 1, root_weight, bias) is_open_spline, 1, root_weight, bias)
assert output.cpu().tolist() == expected_output.tolist() assert output.cpu().tolist() == expected_output.tolist()
x, weight, pseudo = Variable(x), Variable(weight), Variable(pseudo)
root_weight, bias = Variable(root_weight), Variable(bias)
output = spline_conv(x, edge_index, pseudo, weight, kernel_size,
is_open_spline, 1, root_weight, bias)
assert output.data.cpu().tolist() == expected_output.tolist()
@pytest.mark.skipif(not torch.cuda.is_available(), reason='no CUDA') @pytest.mark.skipif(not torch.cuda.is_available(), reason='no CUDA')
def test_spline_weighting_backward_gpu(): def test_spline_weighting_backward_gpu(): # pragma: no cover
for degree in implemented_degrees.keys(): for degree in implemented_degrees.keys():
kernel_size = torch.cuda.LongTensor([5, 5, 5]) kernel_size = torch.cuda.LongTensor([5, 5, 5])
is_open_spline = torch.cuda.ByteTensor([1, 0, 1]) is_open_spline = torch.cuda.ByteTensor([1, 0, 1])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment