Skip to content

Commit

Permalink
Made test_ndarray_batch_source python 3 compatible.
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Nagel committed Dec 4, 2015
1 parent 32a7797 commit d683774
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/transformers/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,13 @@ def test_ndarray_batch_source(self):
for loc in [(0, 0), (0, 1), (1, 0), (1, 1)]:
stream = FixedSizeCrop(self.batch_stream, (5, 4),
which_sources=('source1',), location=loc)
batch = stream.get_epoch_iterator().next()
assert batch[0].shape[1:] == (3, 5, 4)
assert batch[0].shape[0] in (1, 2)
# seen indices should only be of that length in after last location
if 3 * 7 * 5 == len(seen_indices):
assert False
seen_indices = numpy.union1d(seen_indices, batch[0].flatten())
for batch in stream.get_epoch_iterator():
assert batch[0].shape[1:] == (3, 5, 4)
assert batch[0].shape[0] in (1, 2)
seen_indices = numpy.union1d(seen_indices, batch[0].flatten())
assert 3 * 7 * 5 == len(seen_indices)

def test_list_batch_source(self):
Expand Down

0 comments on commit d683774

Please sign in to comment.