test fixes

Summary: Some random seed changes. Skip multigpu tests when there's only one gpu. This is a better fix for what AI is doing in D80600882.

Reviewed By: MichaelRamamonjisoa

Differential Revision: D80625966

fbshipit-source-id: ac3952e7144125fd3a05ad6e4e6e5976ae10a8ef
This commit is contained in:
Jeremy Reizenstein
2025-08-27 06:55:50 -07:00
committed by Facebook GitHub Bot
parent 50f8efa1cb
commit dd068703d1
8 changed files with 17 additions and 8 deletions

View File

@@ -17,7 +17,7 @@ from pytorch3d.structures.pointclouds import (
Pointclouds,
)
from .common_testing import TestCaseMixin
from .common_testing import needs_multigpu, TestCaseMixin
class TestPointclouds(TestCaseMixin, unittest.TestCase):
@@ -703,6 +703,7 @@ class TestPointclouds(TestCaseMixin, unittest.TestCase):
self.assertEqual(cuda_device, cloud.device)
self.assertIsNot(cloud, converted_cloud)
@needs_multigpu
def test_to_list(self):
cloud = self.init_cloud(5, 100, 10)
device = torch.device("cuda:1")
@@ -740,6 +741,7 @@ class TestPointclouds(TestCaseMixin, unittest.TestCase):
self.assertTrue(cloud._P == new_cloud._P)
self.assertTrue(cloud._C == new_cloud._C)
@needs_multigpu
def test_to_tensor(self):
cloud = self.init_cloud(5, 100, 10, lists_to_tensors=True)
device = torch.device("cuda:1")