I am using BatchNorm1d proceeding a linear layer and the input to BatchNorm1d is 2-dimensional. But I get the error message “torch.autograd.backward(self, gradient, retain_graph, create_graph)
File “anaconda3/lib/python3.7/site-packages/torch/autograd/init.py”, line 99, in backward
allow_unreachable=True)  # allow_unreachable flag
RuntimeError: tensor does not have a device”
The pytorch version is 1.4.0.
However, this code works with pytorch 0.1.12. Anyone has any ideas on fixing this bug? Thanks a lot.