The affine parameters won’t be used, if you register the weight and bias with None.
The PyTorch nn.BatchNorm implementation does the same in these lines of code 4.
I’m not familiar with the linked repository, but could you replace it with a valid parameter (or just remove these lines), if you think they might cause the issue?