Cuda RuntimeError:

The problem encountered is weird.
on one hand,the code is OK for ubuntu16.04+cuda8.0+Titan X+Pytorch0.3.1.
However,it’s not the same thing with Pytorch0.4.1

when excecuted with Pytorch 0.4.1,it shows something wrong like below:

THCudaCheck FAIL file=/pytorch/aten/src/THC/generated/…/generic/ line=18 error=8 : invalid device function
Traceback (most recent call last):
File “/home/zzqiuzz/Work/XNOR-Net-PyTorch-master/MNIST/”, line 190, in
File “/home/zzqiuzz/Work/XNOR-Net-PyTorch-master/MNIST/”, line 37, in train
File “/home/zzqiuzz/Work/XNOR-Net-PyTorch-master/MNIST/”, line 33, in binarization
File “/home/zzqiuzz/Work/XNOR-Net-PyTorch-master/MNIST/”, line 42, in meancenterConvParams
negMean = self.target_modules[index].data.mean(1, keepdim=True).
RuntimeError: cuda runtime error (8) : invalid device function at /pytorch/aten/src/THC/generated/…/generic/

And I’m newbee for Pytorch with few days learning.
THanks for helping!