deep-learning-with-pytorch / dlwpt-code

Code for the book Deep Learning with PyTorch by Eli Stevens, Luca Antiga, and Thomas Viehmann.

Home Page:https://www.manning.com/books/deep-learning-with-pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possible error in NetResDeep

patrickfinke opened this issue · comments

Hello!

In p1ch8/1_convolution.ipynb's NetResDeep.__init__() ("In [56]:") it says

self.resblocks = nn.Sequential(*(n_blocks * [ResBlock(n_chans=n_chans1)]))

This leads to all entries in the list referencing the same instance of ResBlock. Is this intended? Maybe the line should read

self.resblocks = nn.Sequential(*[ResBlock(n_chans=n_chans1) for _ in range(n_blocks)])