fix a bug

the original code don't register the downsamper module into the parent Module.
This commit is contained in:
Hu Ye
2023-11-24 20:19:04 +08:00
committed by GitHub
parent 95ae56bd22
commit 6447afa4c2

View File

@@ -485,7 +485,7 @@ class DownBlock2D(nn.Module):
self.resnets = nn.ModuleList(resnets)
if add_downsample:
self.downsamplers = [Downsample2D(out_channels, out_channels=out_channels)]
self.downsamplers = nn.ModuleList([Downsample2D(out_channels, out_channels=out_channels)])
else:
self.downsamplers = None