mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Add None return type to init -- tests (#132352)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/132352 Approved by: https://github.com/ezyang ghstack dependencies: #132335, #132351
This commit is contained in:
committed by
PyTorch MergeBot
parent
a6985c09cb
commit
221350e3a4
@ -156,7 +156,7 @@ def output_graph(a, b, c, iters: int):
|
||||
|
||||
|
||||
class SubModule(nn.Module):
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.a = 11
|
||||
self.b = 2
|
||||
@ -166,7 +166,7 @@ class SubModule(nn.Module):
|
||||
|
||||
|
||||
class SubModule2(nn.Module):
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.a = 12
|
||||
self.b = 2
|
||||
@ -177,7 +177,7 @@ class SubModule2(nn.Module):
|
||||
|
||||
|
||||
class TestModule(nn.Module):
|
||||
def __init__(self):
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.sub1 = SubModule()
|
||||
self.sub2 = SubModule2()
|
||||
|
Reference in New Issue
Block a user