def test_serialize_round_trip(self):
    np.random.seed(1)
    raw_data = create_random_data(10)
    tfexamples = list(map(preprocessing.make_tf_example, *zip(*raw_data)))
    with tempfile.NamedTemporaryFile() as f:
        preprocessing.write_tf_examples(f.name, tfexamples)
        recovered_data = self.extract_data(f.name)
    self.assertEqualData(raw_data, recovered_data)
def test_serialize_round_trip(self):
    np.random.seed(1)
    raw_data = create_random_data(10)
    tfexamples = list(map(preprocessing.make_tf_example, *zip(*raw_data)))
    with tempfile.NamedTemporaryFile() as f:
        preprocessing.write_tf_examples(f.name, tfexamples)
        recovered_data = self.extract_data(f.name)
    self.assertEqualData(raw_data, recovered_data)