diff --git a/pytorch3d/implicitron/tools/config.py b/pytorch3d/implicitron/tools/config.py index 3289bd32b..d20759831 100644 --- a/pytorch3d/implicitron/tools/config.py +++ b/pytorch3d/implicitron/tools/config.py @@ -944,7 +944,7 @@ def init(self, *args, **kwargs) -> None: torch.nn.Module.__init__(self) getattr(self, _DATACLASS_INIT)(*args, **kwargs) - assert not hasattr(some_class, _DATACLASS_INIT) + assert _DATACLASS_INIT not in some_class.__dict__ setattr(some_class, _DATACLASS_INIT, some_class.__init__) some_class.__init__ = init