Skip to content

Commit a4ce3f4

Browse files
Viswesh Sankaranfacebook-github-bot
authored andcommitted
Fix type hint warnings for common_methods_invocations.py (#44971)
Summary: Fixes a subtask of #42969 Tested the following and no warnings were seen. python test/test_type_hints.py .... ---------------------------------------------------------------------- Ran 4 tests in 180.759s OK Pull Request resolved: #44971 Reviewed By: walterddr Differential Revision: D23822274 Pulled By: visweshfb fbshipit-source-id: e3485021e348ee0a8508a9d128f04bad721795ef
1 parent c253b10 commit a4ce3f4

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

mypy.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ ignore_errors = True
6262
[mypy-torch.testing._internal.hypothesis_utils.*]
6363
ignore_errors = True
6464

65-
[mypy-torch.testing._internal.common_methods_invocations.*]
66-
ignore_errors = True
67-
6865
[mypy-torch.testing._internal.common_nn.*]
6966
ignore_errors = True
7067

torch/testing/_internal/common_methods_invocations.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from torch._six import inf, istuple
88
from torch.autograd import Variable
99

10+
from typing import List, Tuple, Dict, Any
11+
1012
from torch.testing import \
1113
(make_non_contiguous, _dispatch_dtypes,
1214
floating_types, floating_types_and, floating_and_complex_types,
@@ -1540,7 +1542,7 @@ def _compare_large_trilu_indices(
15401542
(2028, 1, -1)
15411543
]
15421544

1543-
tri_large_tests_args = [
1545+
tri_large_tests_args: List[Tuple[int, ...]] = [
15441546
# Large test cases below are deliberately commented out to speed up CI
15451547
# tests and to avoid OOM error. When modifying implementations of
15461548
# tril_indices and triu_indices, please enable these tests and make sure
@@ -1602,9 +1604,9 @@ def unpack_variables(args):
16021604
'reshape',
16031605
'where' # argument order
16041606
}
1605-
EXCLUDE_GRADCHECK = {
1607+
EXCLUDE_GRADCHECK: Dict[str, Any] = {
16061608
}
1607-
EXCLUDE_GRADGRADCHECK = {
1609+
EXCLUDE_GRADGRADCHECK: Dict[str, Any] = {
16081610
}
16091611
EXCLUDE_GRADGRADCHECK_BY_TEST_NAME = {
16101612
# *det methods uses svd in backward when matrix is not invertible. However,

0 commit comments

Comments
 (0)