f2073333b710a340403843763ba60eb1e6699916,examples/data_process/tutorial_fast_affine_transform.py,,example3,#,63

Before Change


    dataset = dataset.batch(batch_size)  // TODO: consider using tf.contrib.map_and_batch
    dataset = dataset.prefetch(1)  // prefetch 1 batch
    iterator = dataset.make_one_shot_iterator()
    one_element = iterator.get_next()
    sess = tf.Session()
    // feed `one_element` into a network, for demo, we simply get the data as follows
    n_step = round(n_epoch * n_data / batch_size)
    st = time.time()
    for _ in range(n_step):
        _images, _targets = sess.run(one_element)
    print("dataset APIs took %fs for each image" % ((time.time() - st) / batch_size / n_step))  // CPU ~ 100%


def example4():

After Change


    for img, target in dataset:
        n_step += 1
        pass
    assert n_step == n_epoch * n_data / batch_size
    print("dataset APIs took %fs for each image" % ((time.time() - st) / batch_size / n_step))  // CPU ~ 100%


def example4():
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: tensorlayer/tensorlayer
Commit Name: f2073333b710a340403843763ba60eb1e6699916
Time: 2019-04-11
Author: rundi_wu@pku.edu.cn
File Name: examples/data_process/tutorial_fast_affine_transform.py
Class Name:
Method Name: example3


Project Name: GPflow/GPflow
Commit Name: cc5e7d00a6696a8cf6e40686455e7e034fbf26ff
Time: 2017-09-28
Author: art.art.v@gmail.com
File Name: testing/test_kerns.py
Class Name: TestAdd
Method Name: test_asym


Project Name: tensorlayer/tensorlayer
Commit Name: 910e1e544793c0ca9859a5a4f1c0171104166dc3
Time: 2019-03-10
Author: jingqing.zhang15@imperial.ac.uk
File Name: tests/layers/test_layers_core_basedense_dropout.py
Class Name: Layer_Core_Test
Method Name: test_modellayer