title: Overflow when unpacking long - Pytorch
body: <p>I am running the following code </p>
  
  <pre><code>import torch
  from __future__ import print_function
  x = torch.empty(5, 3)
  print(x)
  </code></pre>
  
  <p>on an Ubuntu machine in CPU mode, which gives me following error, what would be the reason and how to fix</p>
  
  <pre><code>      x = torch.empty(5, 3)
  ----&gt; print(x)
  
  /usr/local/lib/python3.6/dist-packages/torch/tensor.py in __repr__(self)
       55         # characters to replace unicode characters with.
       56         if sys.version_info &gt; (3,):
  ---&gt; 57             return torch._tensor_str._str(self)
       58         else:
       59             if hasattr(sys.stdout, 'encoding'):
  
  /usr/local/lib/python3.6/dist-packages/torch/_tensor_str.py in _str(self)
      216             suffix = ', dtype=' + str(self.dtype) + suffix
      217 
  --&gt; 218         fmt, scale, sz = _number_format(self)
      219         if scale != 1:
      220             prefix = prefix + SCALE_FORMAT.format(scale) + ' ' * indent
  
  /usr/local/lib/python3.6/dist-packages/torch/_tensor_str.py in _number_format(tensor, min_sz)
       94     # TODO: use fmod?
       95     for value in tensor:
  ---&gt; 96         if value != math.ceil(value.item()):
       97             int_mode = False
       98             break
  
  RuntimeError: Overflow when unpacking long
  </code></pre>