mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2026-01-17 03:40:34 +08:00
use assertClose
Summary: use assertClose in some tests, which enforces shape equality. Fixes some small problems, including graph_conv on an empty graph. Reviewed By: nikhilaravi Differential Revision: D20556912 fbshipit-source-id: 60a61eafe3c03ce0f6c9c1a842685708fb10ac5b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
744ef0c2c8
commit
595aca27ea
@@ -898,7 +898,7 @@ class TestMeshes(TestCaseMixin, unittest.TestCase):
|
||||
|
||||
face_areas = mesh.faces_areas_packed()
|
||||
expected_areas = torch.tensor([0.125, 0.2])
|
||||
self.assertTrue(torch.allclose(face_areas, expected_areas))
|
||||
self.assertClose(face_areas, expected_areas)
|
||||
|
||||
def test_compute_normals(self):
|
||||
|
||||
@@ -959,9 +959,9 @@ class TestMeshes(TestCaseMixin, unittest.TestCase):
|
||||
# Multiple meshes in the batch with equal sized meshes
|
||||
meshes_extended = mesh.extend(3)
|
||||
for m in meshes_extended.verts_normals_list():
|
||||
self.assertTrue(torch.allclose(m, verts_normals_expected))
|
||||
self.assertClose(m, verts_normals_expected)
|
||||
for f in meshes_extended.faces_normals_list():
|
||||
self.assertTrue(torch.allclose(f, faces_normals_expected))
|
||||
self.assertClose(f, faces_normals_expected)
|
||||
|
||||
# Multiple meshes in the batch with different sized meshes
|
||||
# Check padded and packed normals are the correct sizes.
|
||||
|
||||
Reference in New Issue
Block a user