#NEWLINE# def test_list_batch_source( self ) : #NEWLINE# #INDENT# stream = RandomFixedSizeCrop ( self . batch_stream , ( 5 , 4 ) , which_sources = ( 'source2' , ) ) #NEWLINE# seen_indices = numpy . array ( [ ] , dtype = 'uint8' ) #NEWLINE# for i in range ( 30 ) : #NEWLINE# #INDENT# for batch in stream . get_epoch_iterator ( ) : #NEWLINE# #INDENT# for example in batch [ 1 ] : #NEWLINE# #INDENT# assert ( example . shape == ( 2 , 5 , 4 ) ) #NEWLINE# seen_indices = numpy . union1d ( batch , example . flatten ( ) ) #NEWLINE# #UNINDENT# assert ( len ( batch [ 1 ] ) in ( 1 , 2 ) ) #NEWLINE# #UNINDENT# if ( self . source2_biggest == len ( seen_indices ) ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# assert False