sess.run(next_element)
def testMapAndBatchParallelGetNext(self):
- iterator = (dataset_ops.Dataset.range(500000)
+ iterator = (dataset_ops.Dataset.range(50000)
.apply(batching.map_and_batch(lambda x: x, batch_size=100))
.make_one_shot_iterator())
elements = []
for _ in range(100):
elements.append(iterator.get_next())
with self.test_session() as sess:
- for i in range(50):
+ for i in range(5):
got = sess.run(elements)
got.sort(key=lambda x: x[0])
expected = []
def testMapAndBatchParallelGetNextDropRemainder(self):
iterator = (
- dataset_ops.Dataset.range(499999).apply(
+ dataset_ops.Dataset.range(49999).apply(
batching.map_and_batch(
lambda x: x, batch_size=100, drop_remainder=True))
.make_one_shot_iterator())
for _ in range(100):
elements.append(iterator.get_next())
with self.test_session() as sess:
- for i in range(49):
+ for i in range(4):
got = sess.run(elements)
got.sort(key=lambda x: x[0])
expected = []