File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
- # mypy: allow-untyped-defs
2
1
import contextlib
3
2
import importlib
4
3
import logging
4
+ from typing import Tuple , Union
5
5
6
6
import torch
7
7
import torch .testing
18
18
log = logging .getLogger (__name__ )
19
19
20
20
21
- def run_tests (needs = ()):
21
+ def run_tests (needs : Union [ str , Tuple [ str , ...]] = ()) -> None :
22
22
from torch .testing ._internal .common_utils import run_tests
23
23
24
24
if TEST_WITH_TORCHDYNAMO or IS_WINDOWS or TEST_WITH_CROSSREF :
@@ -42,12 +42,12 @@ class TestCase(TorchTestCase):
42
42
_exit_stack : contextlib .ExitStack
43
43
44
44
@classmethod
45
- def tearDownClass (cls ):
45
+ def tearDownClass (cls ) -> None :
46
46
cls ._exit_stack .close ()
47
47
super ().tearDownClass ()
48
48
49
49
@classmethod
50
- def setUpClass (cls ):
50
+ def setUpClass (cls ) -> None :
51
51
super ().setUpClass ()
52
52
cls ._exit_stack = contextlib .ExitStack () # type: ignore[attr-defined]
53
53
cls ._exit_stack .enter_context ( # type: ignore[attr-defined]
@@ -58,13 +58,13 @@ def setUpClass(cls):
58
58
),
59
59
)
60
60
61
- def setUp (self ):
61
+ def setUp (self ) -> None :
62
62
self ._prior_is_grad_enabled = torch .is_grad_enabled ()
63
63
super ().setUp ()
64
64
reset ()
65
65
utils .counters .clear ()
66
66
67
- def tearDown (self ):
67
+ def tearDown (self ) -> None :
68
68
for k , v in utils .counters .items ():
69
69
print (k , v .most_common ())
70
70
reset ()
You can’t perform that action at this time.
0 commit comments