mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Add explicit typing to nn.Module.__init__() parameters (#157389)
Fixes #156740 Adds explicit `Any` typing to `*args` and `**kwargs` in `nn.Module.__init__()` to fix type checker errors in strict mode. Pull Request resolved: https://github.com/pytorch/pytorch/pull/157389 Approved by: https://github.com/Skylion007, https://github.com/Raman-RH
This commit is contained in:
committed by
PyTorch MergeBot
parent
52dd7a898c
commit
03f34fd307
@ -476,7 +476,7 @@ class Module:
|
||||
call_super_init: bool = False
|
||||
_compiled_call_impl: Optional[Callable] = None
|
||||
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||
"""Initialize internal Module state, shared by both nn.Module and ScriptModule."""
|
||||
torch._C._log_api_usage_once("python.nn_module")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user