-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Closed
Labels
Description
Hi, this issue may be already known as improve tensor printing in #5, but I'm filing it here just to make sure it doesn't slip through since I was very surprised my tensors appeared to be very large. The print function currently shows the exponent for large numbers, but interestingly doesn't show the exponent for small numbers.
In [11]: x = 1e10*torch.randn(4)
In [12]: x
Out[12]:
7.9325e+09
9.7808e+08
-3.4591e+09
5.9174e+09
[torch.FloatTensor of size 4]
In [7]: x = 1e-10*torch.randn(4)
In [8]: x
Out[8]:
0.5974
-0.6484
-1.4333
-0.5847
[torch.FloatTensor of size 4]
In [9]: x.numpy()
Out[9]:
array([ 5.97383323e-11, -6.48383500e-11, -1.43326517e-10,
-5.84739063e-11], dtype=float32)