def _extract_labels(filename, num_labels):
 print('Extracting labels from: ', filename)
 with gzip.open(filename) as bytestream:
  bytestream.read(8)
  buf = bytestream.read((1 * num_labels))
  labels = np.frombuffer(buf, dtype=np.uint8).astype(np.int64)
 return labels

def _extract_labels ( filename , num_labels ) : print ( 'Extracting labels from: ' , filename ) with gzip . open ( filename ) as bytestream : bytestream . read ( 8 ) buf = bytestream . read ( ( 1 * num_labels ) ) labels = np . frombuffer ( buf , dtype = np . uint8 ) . astype ( np . int64 ) return labels
extract the labels into a vector of int64 label ids .