Hi guys, when tested with batchnorm layers now, i was confused by something:
input = torch.rand(10,5)
model = nn.BatchNorm1d(5)
out = model(input)
print(out.mean(0), out.var(0))

Here I would expect the mean be zero while var be 1 if I didn’t misunderstand the original batchnorm operation cause we havent update the gamma and beta value of the batchnorm layer. However, i always get a strange value such as 1.1102 for var and ~0 for mean. Any suggestions?
Besides, I will get 1 and 0 for weight and bias(gamma and beta) when:
print(model.weight, model.bias)