Skip to content

Commit

Permalink
Lite: Don't pop value if they don't exist (#10613)
Browse files Browse the repository at this point in the history
  • Loading branch information
tchaton authored and rohitgr7 committed Nov 20, 2021
1 parent 3d43010 commit db1b960
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pytorch_lightning/lite/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ def _wrap_init(f: Callable) -> Callable:
@functools.wraps(f)
def wrapper(module: Any, *args: Any, **kwargs: Dict[str, Any]) -> None:
params = dict(inspect.signature(module._old_init).parameters)
params.pop("args")
params.pop("kwargs")
params.pop("args", None)
params.pop("kwargs", None)
for init_name, init_arg in chain(zip(params, args), kwargs.items()):
setattr(module, init_name, init_arg)
f(module, *args, **kwargs)
Expand Down

0 comments on commit db1b960

Please sign in to comment.