Error while forwarding noise to GAN network

I am creating a fake noise image to forward to my Generator as following:

noise = torch.randn(16, 100, 1, 1, device=var.DEVICE)
# noise shape = torch.Size([16, 100, 1, 1])

fake = netG(noise)

And then I get the following message when it passes through the BatchNorm layer:

File "main.py", line 108, in main
    fake = netG(noise)
  File Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "dcgan\generator.py", line 40, in forward
    return self.main(input)
  File "Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "Anaconda3\lib\site-packages\torch\nn\modules\container.py", line 141, in forward
    input = module(input)
  File "Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "Anaconda3\lib\site-packages\torch\nn\modules\batchnorm.py", line 168, in forward
    return F.batch_norm(
  File "Anaconda3\lib\site-packages\torch\nn\functional.py", line 2282, in batch_norm
    return torch.batch_norm(

Is it some parameter I am messing up?

Apparently, the problem was around the Generator’s Batch Norm input, it was with a different size - it was expecting other value.