Skip to content

Commit 9d07569

Browse files
authored
Replace the out of date super init method
According to this docs: https://github.com/pytorch/pytorch/blob/master/torch/nn/modules/module.py#L379 We should use `super().__init__()` than `Super(NeuralNetwork, self).__init__()`
1 parent 48c31c4 commit 9d07569

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

beginner_source/basics/buildmodel_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
class NeuralNetwork(nn.Module):
5151
def __init__(self):
52-
super(NeuralNetwork, self).__init__()
52+
super().__init__()
5353
self.flatten = nn.Flatten()
5454
self.linear_relu_stack = nn.Sequential(
5555
nn.Linear(28*28, 512),

0 commit comments

Comments
 (0)