mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-19 05:40:34 +08:00
Fix camera clone() with torch.save
Summary: User reported that cloned cameras fail to save. The error with latest PyTorch is ``` pickle.PicklingError: Can't pickle ~T_destination: attribute lookup T_destination on torch.nn.modules.module failed ``` This fixes it. Reviewed By: btgraham Differential Revision: D39692258 fbshipit-source-id: 75bbf3b8dfa0023dc28bf7d4cc253ca96e46a64d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ce3fce49d7
commit
efea540bbc
@@ -31,6 +31,7 @@
|
||||
# SOFTWARE.
|
||||
|
||||
import math
|
||||
import pickle
|
||||
import typing
|
||||
import unittest
|
||||
from itertools import product
|
||||
@@ -1333,6 +1334,11 @@ class TestPerspectiveProjection(TestCaseMixin, unittest.TestCase):
|
||||
# Check in_ndc is handled correctly
|
||||
self.assertEqual(cam._in_ndc, c0._in_ndc)
|
||||
|
||||
def test_clone_picklable(self):
|
||||
camera = PerspectiveCameras()
|
||||
pickle.dumps(camera)
|
||||
pickle.dumps(camera.clone())
|
||||
|
||||
|
||||
############################################################
|
||||
# FishEye Camera #
|
||||
|
||||
Reference in New Issue
Block a user