"docs/vscode:/vscode.git/clone" did not exist on "786ec3254d54b00fd40c6a517c8f22b1642bbfc7"
Unverified Commit 8985b598 authored by Philip Meier's avatar Philip Meier Committed by GitHub
Browse files

Relax mypy in prototype namespace (#7091)

parent f71c4308
......@@ -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
......
......@@ -98,7 +98,7 @@ class Datapoint(torch.Tensor):
# `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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment