Пример #1
0
 def test_shape(self, batch_size, device, dtype):
     B: int = batch_size
     focal: float = 100.0
     image = torch.rand(B, 3, 4, 4, device=device, dtype=dtype)
     camera_matrix = epi.intrinsics_like(focal, image)
     assert camera_matrix.shape == (B, 3, 3)
     assert camera_matrix.device == image.device
     assert camera_matrix.dtype == image.dtype
Пример #2
0
 def test_smoke(self, device, dtype):
     image = torch.rand(1, 3, 4, 4, device=device, dtype=dtype)
     focal = torch.rand(1, device=device, dtype=dtype)
     camera_matrix = epi.intrinsics_like(focal, image)
     assert camera_matrix.shape == (1, 3, 3)