mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Add None return type to init -- tests rest (#132376)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132376 Approved by: https://github.com/jamesjwu ghstack dependencies: #132335, #132351, #132352
This commit is contained in:
committed by
PyTorch MergeBot
parent
221350e3a4
commit
920f0426ae
@ -31,17 +31,17 @@ class TestBuiltins(JitTestCase):
|
||||
|
||||
def test_has_attr(self):
|
||||
class HasA(torch.nn.Module):
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.a = 0
|
||||
|
||||
class HasB(torch.nn.Module):
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.b = 1
|
||||
|
||||
class Mod(torch.nn.Module):
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.mods = torch.nn.ModuleList([HasA(), HasB()])
|
||||
|
||||
@ -62,7 +62,7 @@ class TestBuiltins(JitTestCase):
|
||||
|
||||
def test_has_attr_invalid_args(self):
|
||||
class Mod(torch.nn.Module):
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.mod = torch.nn.Linear(1, 1)
|
||||
|
||||
|
Reference in New Issue
Block a user