"git@developer.sourcefind.cn:OpenDAS/apex.git" did not exist on "cebbb04f9b712ea149d668eab621df690659700d"
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 ...@@ -7,7 +7,7 @@ allow_redefinition = True
no_implicit_optional = True no_implicit_optional = True
warn_redundant_casts = True warn_redundant_casts = True
[mypy-torchvision.prototype.features.*] [mypy-torchvision.prototype.datapoints.*]
; untyped definitions and calls ; untyped definitions and calls
disallow_untyped_defs = True disallow_untyped_defs = True
...@@ -17,7 +17,6 @@ no_implicit_optional = True ...@@ -17,7 +17,6 @@ no_implicit_optional = True
; warnings ; warnings
warn_unused_ignores = True warn_unused_ignores = True
warn_return_any = True
; miscellaneous strictness flags ; miscellaneous strictness flags
allow_redefinition = True allow_redefinition = True
...@@ -46,8 +45,6 @@ no_implicit_optional = True ...@@ -46,8 +45,6 @@ no_implicit_optional = True
; warnings ; warnings
warn_unused_ignores = True warn_unused_ignores = True
warn_return_any = True
warn_unreachable = True
; miscellaneous strictness flags ; miscellaneous strictness flags
allow_redefinition = True allow_redefinition = True
......
...@@ -98,7 +98,7 @@ class Datapoint(torch.Tensor): ...@@ -98,7 +98,7 @@ class Datapoint(torch.Tensor):
# `args = (torch.Tensor(), datapoints.Image())` first. Without this guard, the original `torch.Tensor` would # `args = (torch.Tensor(), datapoints.Image())` first. Without this guard, the original `torch.Tensor` would
# be wrapped into a `datapoints.Image`. # be wrapped into a `datapoints.Image`.
if wrapper and isinstance(args[0], cls): 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_(...)`, # 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. # 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