From 9d0756907845b2a2cc65bfa4e06b5768e4b3525c Mon Sep 17 00:00:00 2001 From: yingshaoxo Date: Tue, 21 Feb 2023 16:45:19 +0800 Subject: [PATCH] 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__()` --- beginner_source/basics/buildmodel_tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beginner_source/basics/buildmodel_tutorial.py b/beginner_source/basics/buildmodel_tutorial.py index da1974fcb0e..d2c0572d1ff 100644 --- a/beginner_source/basics/buildmodel_tutorial.py +++ b/beginner_source/basics/buildmodel_tutorial.py @@ -49,7 +49,7 @@ class NeuralNetwork(nn.Module): def __init__(self): - super(NeuralNetwork, self).__init__() + super().__init__() self.flatten = nn.Flatten() self.linear_relu_stack = nn.Sequential( nn.Linear(28*28, 512),