mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-12-19 05:40:34 +08:00
FrameAnnotation.meta, Optional in _dataclass_from_dict
Summary: Allow extra data in a FrameAnnotation. Therefore allow Optional[T] systematically in _dataclass_from_dict Reviewed By: davnov134 Differential Revision: D36442691 fbshipit-source-id: ba70f6491574c08b0d9c9acb63f35514d29de214
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f36b11fe49
commit
f632c423ef
@@ -85,6 +85,10 @@ class TestDatasetTypes(unittest.TestCase):
|
||||
self._compare_with_scalar([dct], List[FrameAnnotation])
|
||||
self._compare_with_scalar({"k": dct}, Dict[str, FrameAnnotation])
|
||||
|
||||
dct2 = dct.copy()
|
||||
dct2["meta"] = {"d": 76}
|
||||
self._compare_with_scalar(dct2, FrameAnnotation)
|
||||
|
||||
def _compare_with_scalar(self, obj, typeannot, repeat=3):
|
||||
input = [obj] * 3
|
||||
vect_output = types._dataclass_list_from_dict_list(input, typeannot)
|
||||
|
||||
Reference in New Issue
Block a user