I need to load raw int16 binary files on-the-fly during training.  In Lua Torch I could just do the following:
img = torch.ShortStorage(filename)

It appears that that functionality does not exist in PyTorch.  So instead I am loading into a numpy array as follows:
img = np.fromfile(filename, 'int16')

The problem is that np.fromfile is extremely slow.  For my large data files (>100MB), np.fromfile loads four orders of magnitude slower than the old torch.ShortStorage method.  How can I get the fast load speeds in PyTorch?