I’ve installed PyTorch 1.1.0 for Python2.7 and used your code snippet in python and ipython.
Both yield valid results and I cannot reproduce this issue.
Do you also get a None output for nn.BatchNorm2d?
Could you update PyTorch to the latest stable release (1.2.0) and check it again?