This commit is contained in:
Justin committed 2023-06-21 18:51:02 +00:00
commit 75d1013d60
1 file changed
+3 -1
+3 -1
View File
@@ -100,7 +100,9 @@ class CameraOptimizer(nn.Module):
assert_never(self.config.mode)
# Detach non-trainable indices by setting to identity transform
if self.non_trainable_camera_indices is not None:
outputs[0][self.non_trainable_camera_indices] = torch.eye(4, device=self.device)[:3, :4]
if self.non_trainable_camera_indices.device != self.pose_adjustment.device:
self.non_trainable_camera_indices = self.non_trainable_camera_indices.to(self.pose_adjustment.device)
outputs[0][self.non_trainable_camera_indices] = torch.eye(4, device=self.pose_adjustment.device)[:3, :4]
# Return: identity if no transforms are needed, otherwise multiply transforms together.
if len(outputs) == 0: