Commit 2a8339db authored by rusty1s's avatar rusty1s
Browse files

test different sizes

parent 629213e4
......@@ -4,11 +4,11 @@ from torch_cluster.functions.utils.consecutive import consecutive
def test_consecutive_cpu():
x = torch.LongTensor([0, 3, 2, 2, 3])
assert consecutive(x).tolist() == [0, 2, 1, 1, 2]
x = torch.LongTensor([[0, 3, 2], [2, 3, 0]])
assert consecutive(x).tolist() == [[0, 2, 1], [1, 2, 0]]
@pytest.mark.skipif(not torch.cuda.is_available(), reason='no CUDA')
def test_consecutive_gpu(): # pragma: no cover
x = torch.cuda.LongTensor([0, 3, 2, 2, 3])
assert consecutive(x).cpu().tolist() == [0, 2, 1, 1, 2]
x = torch.cuda.LongTensor([[0, 3, 2], [2, 3, 0]])
assert consecutive(x).cpu().tolist() == [[0, 2, 1], [1, 2, 0]]
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