From db1b960b2ab1f6d2db2a3f09f5e820b2cb40dc85 Mon Sep 17 00:00:00 2001 From: thomas chaton Date: Fri, 19 Nov 2021 14:04:33 +0000 Subject: [PATCH] Lite: Don't pop value if they don't exist (#10613) --- pytorch_lightning/lite/wrappers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytorch_lightning/lite/wrappers.py b/pytorch_lightning/lite/wrappers.py index ff95e89d1d2cf..6b8e44b610352 100644 --- a/pytorch_lightning/lite/wrappers.py +++ b/pytorch_lightning/lite/wrappers.py @@ -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)