def METHOD_NAME(filename, dimension):
    data = open(filename, "rb").read()
    magic_number, length = struct.unpack("II", data[0:8])
    encoded = data[8 : 8 + length]
    features = {
        "data": tf.io.FixedLenFeature([], tf.string),
        "labels": tf.io.FixedLenFeature([], tf.int64),
    }
    parsed = tf.io.parse_single_example(encoded, features)
    array = tf.io.decode_raw(parsed["data"], tf.float64)
    assert array.shape[0] == dimension