@@ -314,7 +314,7 @@ def _compare_square_with_nonsq(
314
314
315
315
# Finally check the gradients of the input vertices for
316
316
# the square and non square case
317
- self .assertClose (verts_square .grad , grad_tensor .grad , rtol = 2e -4 )
317
+ self .assertClose (verts_square .grad , grad_tensor .grad , rtol = 3e -4 )
318
318
319
319
def test_gpu (self ):
320
320
"""
@@ -323,8 +323,9 @@ def test_gpu(self):
323
323
dists, zbuf, bary are all the same for the square
324
324
region which is present in both images.
325
325
"""
326
- # Test both cases: (W > H), (H > W)
327
- image_sizes = [(64 , 128 ), (128 , 64 ), (128 , 256 ), (256 , 128 )]
326
+ # Test both cases: (W > H), (H > W) as well as the case where
327
+ # H and W are not integer multiples of each other (i.e. float aspect ratio)
328
+ image_sizes = [(64 , 128 ), (128 , 64 ), (128 , 256 ), (256 , 128 ), (600 , 1110 )]
328
329
329
330
devices = ["cuda:0" ]
330
331
blurs = [0.0 , 0.001 ]
@@ -391,7 +392,7 @@ def test_cpu(self):
391
392
"""
392
393
# Test both when (W > H) and (H > W).
393
394
# Using smaller image sizes here as the Python rasterizer is really slow.
394
- image_sizes = [(32 , 64 ), (64 , 32 )]
395
+ image_sizes = [(32 , 64 ), (64 , 32 ), ( 60 , 110 ) ]
395
396
devices = ["cpu" ]
396
397
blurs = [0.0 , 0.001 ]
397
398
batch_sizes = [1 ]
@@ -646,8 +647,9 @@ def test_gpu(self):
646
647
dists, zbuf, idx are all the same for the square
647
648
region which is present in both images.
648
649
"""
649
- # Test both cases: (W > H), (H > W)
650
- image_sizes = [(64 , 128 ), (128 , 64 ), (128 , 256 ), (256 , 128 )]
650
+ # Test both cases: (W > H), (H > W) as well as the case where
651
+ # H and W are not integer multiples of each other (i.e. float aspect ratio)
652
+ image_sizes = [(64 , 128 ), (128 , 64 ), (128 , 256 ), (256 , 128 ), (600 , 1110 )]
651
653
652
654
devices = ["cuda:0" ]
653
655
blurs = [5e-2 ]
@@ -713,7 +715,7 @@ def test_cpu(self):
713
715
"""
714
716
# Test both when (W > H) and (H > W).
715
717
# Using smaller image sizes here as the Python rasterizer is really slow.
716
- image_sizes = [(32 , 64 ), (64 , 32 )]
718
+ image_sizes = [(32 , 64 ), (64 , 32 ), ( 60 , 110 ) ]
717
719
devices = ["cpu" ]
718
720
blurs = [5e-2 ]
719
721
batch_sizes = [1 ]
0 commit comments