MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / check_labels_file_header

Function check_labels_file_header

tensorflow/lite/tutorials/dataset.py:57–64  ·  view source on GitHub ↗

Validate that filename corresponds to labels for the MNIST dataset.

(filename)

Source from the content-addressed store, hash-verified

55
56
57def check_labels_file_header(filename):
58 """Validate that filename corresponds to labels for the MNIST dataset."""
59 with tf.gfile.Open(filename, 'rb') as f:
60 magic = read32(f)
61 read32(f) # num_items, unused
62 if magic != 2049:
63 raise ValueError('Invalid magic number %d in MNIST file %s' % (magic,
64 f.name))
65
66
67def download(directory, filename):

Callers 1

datasetFunction · 0.85

Calls 2

read32Function · 0.85
OpenMethod · 0.45

Tested by

no test coverage detected