Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
8985b598
Unverified
Commit
8985b598
authored
Jan 16, 2023
by
Philip Meier
Committed by
GitHub
Jan 16, 2023
Browse files
Relax mypy in prototype namespace (#7091)
parent
f71c4308
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
5 deletions
+2
-5
mypy.ini
mypy.ini
+1
-4
torchvision/prototype/datapoints/_datapoint.py
torchvision/prototype/datapoints/_datapoint.py
+1
-1
No files found.
mypy.ini
View file @
8985b598
...
@@ -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.
feature
s.*]
[mypy-torchvision.prototype.
datapoint
s.*]
; 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
...
...
torchvision/prototype/datapoints/_datapoint.py
View file @
8985b598
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment