MCPcopy
hub / github.com/pyg-team/pytorch_geometric / test_contiguous

Function test_contiguous

test/test_edge_index.py:345–354  ·  view source on GitHub ↗
(dtype, device)

Source from the content-addressed store, hash-verified

343@withCUDA
344@pytest.mark.parametrize('dtype', DTYPES)
345def test_contiguous(dtype, device):
346 kwargs = dict(dtype=dtype, device=device)
347 data = tensor([[0, 1], [1, 0], [1, 2], [2, 1]], **kwargs).t()
348
349 with pytest.raises(ValueError, match="needs to be contiguous"):
350 EdgeIndex(data)
351
352 adj = EdgeIndex(data.contiguous()).contiguous()
353 assert isinstance(adj, EdgeIndex)
354 assert adj.is_contiguous()
355
356
357@withCUDA

Callers

nothing calls this directly

Calls 3

EdgeIndexClass · 0.90
tMethod · 0.80
contiguousMethod · 0.45

Tested by

no test coverage detected