Skip to content

Commit 8985b59

Browse files
authored
Relax mypy in prototype namespace (#7091)
1 parent f71c430 commit 8985b59

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

mypy.ini

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ allow_redefinition = True
77
no_implicit_optional = True
88
warn_redundant_casts = True
99

10-
[mypy-torchvision.prototype.features.*]
10+
[mypy-torchvision.prototype.datapoints.*]
1111

1212
; untyped definitions and calls
1313
disallow_untyped_defs = True
@@ -17,7 +17,6 @@ no_implicit_optional = True
1717

1818
; warnings
1919
warn_unused_ignores = True
20-
warn_return_any = True
2120

2221
; miscellaneous strictness flags
2322
allow_redefinition = True
@@ -46,8 +45,6 @@ no_implicit_optional = True
4645

4746
; warnings
4847
warn_unused_ignores = True
49-
warn_return_any = True
50-
warn_unreachable = True
5148

5249
; miscellaneous strictness flags
5350
allow_redefinition = True

torchvision/prototype/datapoints/_datapoint.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def __torch_function__(
9898
# `args = (torch.Tensor(), datapoints.Image())` first. Without this guard, the original `torch.Tensor` would
9999
# be wrapped into a `datapoints.Image`.
100100
if wrapper and isinstance(args[0], cls):
101-
return wrapper(cls, args[0], output) # type: ignore[no-any-return]
101+
return wrapper(cls, args[0], output)
102102

103103
# Inplace `func`'s, canonically identified with a trailing underscore in their name like `.add_(...)`,
104104
# will retain the input type. Thus, we need to unwrap here.

0 commit comments

Comments
 (0)