Output None when using batchnorm1d in eval mode?

Below is test code

import torch
import torch.nn as nn
data = torch.rand(3, 10, 145)
bn = nn.BatchNorm1d(10)
bn.eval()
print bn(data) is None

Hi xiaoyulun,
I have run your test code and do not get output as None.

Really :scream:, which pytorch version do you use?

I tried in Pytorch 0.4 and 1.1.

Thanks for your help. Below is my result

But when I update pytorch to 1.2.0, the problem is solved

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?

Yes, When I update pytorch to 1.2.0. It can yield valid results. But I didn’t figure out why it is occured in pytorch 1.1.0

I’m still unsure, how this might happen on your system, as I’ve tried to reproduce it using matching versions of Python, Pytorch etc. and wasn’t able to.