mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-22 23:30:35 +08:00
chamfer test consistency
Summary: Modify test_chamfer for more robustness. Avoid empty pointclouds, including where point_reduction is mean, for which we currently return nan (*), and so that we aren't looking at an empty gradient. Make sure we aren't using padding as points in the homogenous cases in the tests, which will lead to a tie between closest points and therefore a potential instability in the gradient - see https://github.com/pytorch/pytorch/issues/35699. (*) This doesn't attempt to fix the nan. Reviewed By: nikhilaravi, gkioxari Differential Revision: D21157322 fbshipit-source-id: a609e84e25a24379c8928ff645d587552526e4af
This commit is contained in:
committed by
Facebook GitHub Bot
parent
faf0885811
commit
9e4bd2e5e0
@@ -123,4 +123,8 @@ class TestCaseMixin(unittest.TestCase):
|
||||
input, other, rtol=rtol, atol=atol, equal_nan=equal_nan
|
||||
)
|
||||
|
||||
if not close and msg is None:
|
||||
max_diff = backend.abs(input - other).max()
|
||||
self.fail(f"Not close. max diff {max_diff}.")
|
||||
|
||||
self.assertTrue(close, msg)
|
||||
|
||||
Reference in New Issue
Block a user