def test_numpy_slices_list_append():
    logger.info('Test reading data of image list.')
    DATA_DIR = ['../data/dataset/test_tf_file_3_images/train-0000-of-0001.data']
    (resize_height, resize_width) = (2, 2)
    data1 = de.TFRecordDataset(DATA_DIR)
    resize_op = vision.Resize((resize_height, resize_width))
    data1 = data1.map(input_columns=['image'], operations=[vision.Decode(True), resize_op])
    res = []
    for data in data1.create_dict_iterator():
        res.append(data['image'])
    ds = de.NumpySlicesDataset(res, column_names=['col1'], shuffle=False)
    for (i, data) in enumerate(ds):
        assert np.equal(data, res[i]).all()
def test_numpy_slices_list_append():
    logger.info('Test reading data of image list.')
    DATA_DIR = ['../data/dataset/test_tf_file_3_images/train-0000-of-0001.data']
    (resize_height, resize_width) = (2, 2)
    data1 = de.TFRecordDataset(DATA_DIR)
    resize_op = vision.Resize((resize_height, resize_width))
    data1 = data1.map(input_columns=['image'], operations=[vision.Decode(True), resize_op])
    res = []
    for data in data1.create_dict_iterator():
        res.append(data['image'])
    ds = de.NumpySlicesDataset(res, column_names=['col1'], shuffle=False)
    for (i, data) in enumerate(ds):
        assert np.equal(data, res[i]).all()