Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
rusty1s committed Jul 7, 2022
1 parent 83c0a1d commit 32db0d0
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions test/transforms/test_to_superpixels.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ def test_to_superpixels():
assert y == 7

loader = DataLoader(dataset, batch_size=2, shuffle=False)
for data, y in loader:
assert len(data) == 4
assert data.pos.dim() == 2 and data.pos.size(1) == 2
assert data.x.dim() == 2 and data.x.size(1) == 1
assert data.batch.dim() == 1
assert data.ptr.dim() == 1
assert data.pos.size(0) == data.x.size(0) == data.batch.size(0)
for batch, y in loader:
assert batch.num_graphs == len(batch) == 2
assert batch.pos.dim() == 2 and batch.pos.size(1) == 2
assert batch.x.dim() == 2 and batch.x.size(1) == 1
assert batch.batch.dim() == 1
assert batch.ptr.dim() == 1
assert batch.pos.size(0) == batch.x.size(0) == batch.batch.size(0)
assert y.tolist() == [7, 2]
break

Expand All @@ -81,15 +81,15 @@ def test_to_superpixels():
assert y == 7

loader = DataLoader(dataset, batch_size=2, shuffle=False)
for data, y in loader:
assert len(data) == 6
assert data.pos.dim() == 2 and data.pos.size(1) == 2
assert data.x.dim() == 2 and data.x.size(1) == 1
assert data.batch.dim() == 1
assert data.ptr.dim() == 1
assert data.pos.size(0) == data.x.size(0) == data.batch.size(0)
assert data.seg.size() == (2, 28, 28)
assert data.img.size() == (2, 1, 28, 28)
for batch, y in loader:
assert batch.num_graphs == len(batch) == 2
assert batch.pos.dim() == 2 and batch.pos.size(1) == 2
assert batch.x.dim() == 2 and batch.x.size(1) == 1
assert batch.batch.dim() == 1
assert batch.ptr.dim() == 1
assert batch.pos.size(0) == batch.x.size(0) == batch.batch.size(0)
assert batch.seg.size() == (2, 28, 28)
assert batch.img.size() == (2, 1, 28, 28)
assert y.tolist() == [7, 2]
break

Expand Down

0 comments on commit 32db0d0

Please sign in to comment.