diff --git a/mypy.ini b/mypy.ini index eb88b233fc0..900c5479c23 100644 --- a/mypy.ini +++ b/mypy.ini @@ -7,7 +7,7 @@ allow_redefinition = True no_implicit_optional = True warn_redundant_casts = True -[mypy-torchvision.prototype.features.*] +[mypy-torchvision.prototype.datapoints.*] ; untyped definitions and calls disallow_untyped_defs = True @@ -17,7 +17,6 @@ no_implicit_optional = True ; warnings warn_unused_ignores = True -warn_return_any = True ; miscellaneous strictness flags allow_redefinition = True @@ -46,8 +45,6 @@ no_implicit_optional = True ; warnings warn_unused_ignores = True -warn_return_any = True -warn_unreachable = True ; miscellaneous strictness flags allow_redefinition = True diff --git a/torchvision/prototype/datapoints/_datapoint.py b/torchvision/prototype/datapoints/_datapoint.py index 659d4e958cc..d6472301e99 100644 --- a/torchvision/prototype/datapoints/_datapoint.py +++ b/torchvision/prototype/datapoints/_datapoint.py @@ -98,7 +98,7 @@ def __torch_function__( # `args = (torch.Tensor(), datapoints.Image())` first. Without this guard, the original `torch.Tensor` would # be wrapped into a `datapoints.Image`. if wrapper and isinstance(args[0], cls): - return wrapper(cls, args[0], output) # type: ignore[no-any-return] + return wrapper(cls, args[0], output) # Inplace `func`'s, canonically identified with a trailing underscore in their name like `.add_(...)`, # will retain the input type. Thus, we need to unwrap here.