diff --git a/holocron/optim/adabelief.py b/holocron/optim/adabelief.py index 346d789ac..70c4b21ce 100644 --- a/holocron/optim/adabelief.py +++ b/holocron/optim/adabelief.py @@ -8,7 +8,7 @@ import torch from torch import Tensor -from torch.optim import Adam +from torch.optim import Adam # type: ignore[attr-defined] __all__ = ["AdaBelief", "adabelief"] diff --git a/holocron/optim/adamp.py b/holocron/optim/adamp.py index 11616221b..00a7488eb 100644 --- a/holocron/optim/adamp.py +++ b/holocron/optim/adamp.py @@ -9,7 +9,7 @@ import torch from torch import Tensor from torch.nn import functional as F -from torch.optim import Adam +from torch.optim import Adam # type: ignore[attr-defined] __all__ = ["AdamP", "adamp"] diff --git a/holocron/optim/adan.py b/holocron/optim/adan.py index bd7c08260..adf321fea 100644 --- a/holocron/optim/adan.py +++ b/holocron/optim/adan.py @@ -8,7 +8,7 @@ import torch from torch import Tensor -from torch.optim import Adam +from torch.optim import Adam # type: ignore[attr-defined] __all__ = ["Adan", "adan"] diff --git a/holocron/optim/ademamix.py b/holocron/optim/ademamix.py index 422c05a03..14b570352 100644 --- a/holocron/optim/ademamix.py +++ b/holocron/optim/ademamix.py @@ -8,7 +8,7 @@ import torch from torch import Tensor -from torch.optim import Optimizer +from torch.optim import Optimizer # type: ignore[attr-defined] __all__ = ["AdEMAMix", "ademamix"] diff --git a/holocron/optim/wrapper.py b/holocron/optim/wrapper.py index fa737efe4..5bcc23c44 100644 --- a/holocron/optim/wrapper.py +++ b/holocron/optim/wrapper.py @@ -30,7 +30,7 @@ class Lookahead(Optimizer): def __init__( self, - base_optimizer: torch.optim.Optimizer, + base_optimizer: torch.optim.Optimizer, # type: ignore[name-defined] sync_rate: float = 0.5, sync_period: int = 6, ) -> None: @@ -154,7 +154,7 @@ class Scout(Optimizer): def __init__( self, - base_optimizer: torch.optim.Optimizer, + base_optimizer: torch.optim.Optimizer, # type: ignore[name-defined] sync_rate: float = 0.5, sync_period: int = 6, ) -> None: diff --git a/holocron/trainer/core.py b/holocron/trainer/core.py index 5f300608a..00101649c 100644 --- a/holocron/trainer/core.py +++ b/holocron/trainer/core.py @@ -48,7 +48,7 @@ def __init__( train_loader: DataLoader, val_loader: DataLoader, criterion: nn.Module, - optimizer: torch.optim.Optimizer, + optimizer: torch.optim.Optimizer, # type: ignore[name-defined] gpu: Optional[int] = None, output_file: str = "./checkpoint.pth", amp: bool = False, diff --git a/pyproject.toml b/pyproject.toml index 61c63f9ec..a10962622 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -204,7 +204,7 @@ quote-style = "double" indent-style = "space" [tool.mypy] -python_version = "3.9" +python_version = "3.11" files = "holocron/" show_error_codes = true pretty = true