title: How to pre-load numpy data into a buffer like io.BytesIO to make it seekable?
body: <p>Following function basically returns <strong>numpy.ndarray</strong></p>
  
  <pre><code>def getimage(id):
       img = self.coco.loadImgs(id)
       I = io.imread(img['coco_url'])
       return I #returns 'numpy.ndarray'     
  </code></pre>
  
  <p>The <strong>getimage</strong> function being called from main:   </p>
  
  <pre><code>x = load.getimage(id).
  x = torch.load(x)
  </code></pre>
  
  <p><strong>Error thrown:</strong></p>
  
  <pre><code>'numpy.ndarray' object has no attribute 'seek'. You can only torch.load from a file that is seekable. Please pre-load the data into a buffer like io.BytesIO and try to load from it instead.
  </code></pre>