Skip to content

Commit

Permalink
fix broken config for GenericModel
Browse files Browse the repository at this point in the history
Summary: D42760349 (9540c29) (make Module.__init__ automatic) didn't account properly for inheritance.

Reviewed By: shapovalov

Differential Revision: D42834466

fbshipit-source-id: 53ee4c788985c1678ad905c06ccf12b2b41361e9
  • Loading branch information
bottler authored and facebook-github-bot committed Jan 29, 2023
1 parent 7dfa691 commit c8af1c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pytorch3d/implicitron/tools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c8af1c4

Please sign in to comment.