def load_batch(fpath): with open(fpath, 'rb') as f: d = pickle.load(f, encoding='latin1') data = d["data"] labels = d["labels"] return data, labels