diff --git a/mypy.ini b/mypy.ini index d00bbe17156..2a18d69e314 100644 --- a/mypy.ini +++ b/mypy.ini @@ -4,15 +4,23 @@ files = torchvision show_error_codes = True pretty = True -;[mypy-torchvision.datasets.*] +[mypy-torchvision.io._video_opt.*] -;ignore_errors = True +ignore_errors = True -[mypy-torchvision.io._video_opt.*] +[mypy-torchvision.io.*] + +ignore_errors = True + +[mypy-torchvision.models.detection.*] + +ignore_errors = True + +[mypy-torchvision.models.densenet.*] ignore_errors = True -[mypy-torchvision.models.*] +[mypy-torchvision.models.quantization.*] ignore_errors = True diff --git a/torchvision/models/googlenet.py b/torchvision/models/googlenet.py index 240c575cc7b..eb774d166ac 100644 --- a/torchvision/models/googlenet.py +++ b/torchvision/models/googlenet.py @@ -193,12 +193,11 @@ def _forward(self, x): return x, aux2, aux1 @torch.jit.unused - def eager_outputs(self, x, aux2, aux1): - # type: (Tensor, Optional[Tensor], Optional[Tensor]) -> GoogLeNetOutputs + def eager_outputs(self, x: Tensor, aux2: Tensor, aux1: Optional[Tensor]) -> GoogLeNetOutputs: if self.training and self.aux_logits: return _GoogLeNetOutputs(x, aux2, aux1) else: - return x + return x # type: ignore[return-value] def forward(self, x): # type: (Tensor) -> GoogLeNetOutputs diff --git a/torchvision/models/inception.py b/torchvision/models/inception.py index 1be9ef2741a..a131c8c754f 100644 --- a/torchvision/models/inception.py +++ b/torchvision/models/inception.py @@ -188,12 +188,11 @@ def _forward(self, x): return x, aux @torch.jit.unused - def eager_outputs(self, x, aux): - # type: (Tensor, Optional[Tensor]) -> InceptionOutputs + def eager_outputs(self, x: torch.Tensor, aux: Optional[Tensor]) -> InceptionOutputs: if self.training and self.aux_logits: return InceptionOutputs(x, aux) else: - return x + return x # type: ignore[return-value] def forward(self, x): x = self._transform_input(x)