@Sangyeon_Kim: Yes, you are right, thanks for the remark.
@JuanFMontesinos: You mean that I have to convert self.batch_norm_list (which holds the BatchNorm layers) into a PyTorch Tensor. But how can I do this? Using torch.tensor(self.batch_norm_list) doesn’t work due to unrecognized element type (in this case, BatchNorm), below is the error message.
<ipython-input-370-e40c7345c9d8> in __init__(self, num_batch_norm)
      4 
      5         self.batch_norm_list = [nn.BatchNorm1d(10) for _ in range(num_batch_norm)]
----> 6         self.batch_norm_list = torch.tensor(self.batch_norm_list)
      7 
      8         self.fc = nn.Linear(10, 2)

RuntimeError: Could not infer dtype of BatchNorm1d