It seems CPU side problem.
import torch
HIGHT = 100
WIDTH = 5000000
torch.manual_seed(0)
W = torch.FloatTensor(HIGHT, WIDTH).normal_(0,1)
Wv = W.view(HIGHT*WIDTH,1)
WTW = Wv * Wv
print(WTW.sum())
print(W.norm(2) ** 2, W.sum())

W = W.cuda()
Wv = W.view(HIGHT*WIDTH,1)
WTW = Wv * Wv
print(WTW.sum())
print(W.norm(2) ** 2, W.sum())

W = W.cpu()
print(W.norm(2) ** 2, W.sum())
!nvidia-smi

tensor(4.8664e+08)
tensor(1.5166e+08) tensor(-34600.6719)
tensor(5.0001e+08, device='cuda:0')
tensor(5.0001e+08, device='cuda:0') tensor(-34600.1719, device='cuda:0')
tensor(1.5166e+08) tensor(-34600.6719)
Mon May 27 07:41:05 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.67       Driver Version: 410.79       CUDA Version: 10.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla T4            Off  | 00000000:00:04.0 Off |                    0 |
| N/A   70C    P0    31W /  70W |   5152MiB / 15079MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+