Skip to content

Commit

Permalink
Add a simple functional unit test of quad_pool2d.
Browse files Browse the repository at this point in the history
  • Loading branch information
ybubnov committed Apr 19, 2024
1 parent f5ee9e6 commit 5b46b40
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions torch_geopooling/functional_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import torch
from torch_geopooling.functional import quad_pool2d


def test_quad_pool2d() -> None:
tiles = torch.tensor([[0, 0, 0]], dtype=torch.int32)
input = torch.rand((100, 2), dtype=torch.float64) * 10.0
weight = torch.randn([64], dtype=torch.float64)
bias = torch.randn([64], dtype=torch.float64)

result = quad_pool2d(tiles, input, weight, bias, (0.0, 0.0, 10.0, 10.0), True)
assert result.tiles.size(0) > 0
assert result.tiles.size(1) == 3

assert result.weight.size(0) > 0
assert result.bias.size(0) > 0

0 comments on commit 5b46b40

Please sign in to comment.