docs: def save(self, filename, compressed=True):
          """ Save a tensor to disk. """
          # check for data
          if not self.has_data:
              return False
  
          # read ext and save accordingly
          _, file_ext = os.path.splitext(filename)
          if compressed:
              if file_ext != COMPRESSED_TENSOR_EXT:
                  raise ValueError('Can only save compressed tensor with %s extension' %(COMPRESSED_TENSOR_EXT))
              np.savez_compressed(filename,
                                  self.data[:self.cur_index,...])
          else:
              if file_ext != TENSOR_EXT:
                  raise ValueError('Can only save tensor with .npy extension')
              np.save(filename, self.data[:self.cur_index,...])
          return True