title: Why does torch.from_numpy require a different byte ordering while matplotlib doesn't?
body: <p>Here is a piece of code (running on Linux CentOS 7.7.1908, x86_64)</p>
  
  <pre><code>import torch    #v1.3.0
  import numpy as np  #v1.14.3
  import matplotlib.pyplot as plt
  from astropy.io.fits import getdata   #v3.0.2
  data, hdr = getdata("afile.fits", 0, header=True) #gives dtype=float32 2d array
  plt.imshow(data)
  plt.show()
  </code></pre>
  
  <p>This gives a nice 512x512 image 
  <a href="https://i.stack.imgur.com/y7PUk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y7PUk.png" alt="enter image description here"></a></p>
  
  <p>Now, I would like to convert "data" into a PyTorch tensor:</p>
  
  <pre><code>a = torch.from_numpy(data)
  </code></pre>
  
  <p>Although, PyTorch raises:</p>
  
  <blockquote>
    <p>ValueError: given numpy array has byte order different from the native
    byte order. Conversion between byte orders is currently not supported.</p>
  </blockquote>
  
  <p>Well, I have tried different manipulations with no success: ie. byteswap(), copy()</p>
  
  <p>An idea?</p>
  
  <p>PS: the same error occurs when I transfer my data to Mac OSX (Mojave) while still matplotlib is ok.</p>