AttributeError: cannot assign module before Module.__init__() call
[Pytorch] nn.module์ ์์๋ฐ์ ๋ super().__init__()์ ํ๋ ์ด์
ํ์ดํ ์น์์ ํด๋์ค๋ก Layer๋ Model์ ๊ตฌํํด์ฃผ๋ฉด ํญ์ ์์ฑ์์์ super(class์ด๋ฆ, self).__init__()์ ์ ๋ ฅํด์ค๋๋ค. ์ ์ด๊ฒ์ ์ ๋ ฅํด์ผ ํ๋์ง ๊ถ๊ธํ์ฌ ์์๋ณด์์ต๋๋ค. super().__init__()์ด ์๋ค๋ฉด? import torch class Test(torch.nn.Module): def __init__(self): self.linear = torch.nn.Linear(3,2) def forward(self,x): return self.linear(x) Test๋ฅผ ์ํด ๊ต์ฅํ ๊ฐ๋จํ torch.nn.Module์ ์์๋ฐ๋ ํด๋์ค๋ฅผ ๋ง๋ค์ด๋ณด์์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ ์ด ํด๋์ค๋ฅผ ํ์ฉํด ๋ชจ๋ธ์ ๋ง๋ค์ด๋ณด๊ฒ ์ต๋๋ค. model = Test() ์์ฑ์ ํ๊ฒ ๋๋ค๋ฉด AttributeErro..