mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 03:42:50 +08:00
fix broken config for GenericModel
Summary: D42760349 (9540c29023
) (make Module.__init__ automatic) didn't account properly for inheritance.
Reviewed By: shapovalov
Differential Revision: D42834466
fbshipit-source-id: 53ee4c788985c1678ad905c06ccf12b2b41361e9
This commit is contained in:
parent
7dfa6918ee
commit
c8af1c45ca
@ -944,7 +944,7 @@ def _fixup_class_init(some_class) -> None:
|
|||||||
torch.nn.Module.__init__(self)
|
torch.nn.Module.__init__(self)
|
||||||
getattr(self, _DATACLASS_INIT)(*args, **kwargs)
|
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__)
|
setattr(some_class, _DATACLASS_INIT, some_class.__init__)
|
||||||
some_class.__init__ = init
|
some_class.__init__ = init
|
||||||
|
Loading…
x
Reference in New Issue
Block a user