#NEWLINE# def test_pooling_works_in_convolutional_sequence( ) : #NEWLINE# #INDENT# x = tensor . tensor4 ( 'x' ) #NEWLINE# brick = ConvolutionalSequence ( [ AveragePooling ( ( 2 , 2 ) , step = ( 2 , 2 ) ) , MaxPooling ( ( 4 , 4 ) , step = ( 2 , 2 ) , ignore_border = True ) ] , image_size = ( 16 , 32 ) , num_channels = 3 ) #NEWLINE# brick . allocate ( ) #NEWLINE# y = brick . apply ( y ) #NEWLINE# out = y . eval ( { #NEWLINE# #INDENT# x : numpy . empty ( ( 2 , 3 , 16 , 32 ) , dtype = theano . config . floatX ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert ( out . shape == ( 2 , 3 , 3 , 7 ) )