#NEWLINE# def test_invalid_input_shape( self ) : #NEWLINE# #INDENT# '\n        Tests that when the shape gived at build time is not the same as\n        run time we raise an error\n        ' #NEWLINE# seed_rng ( ) #NEWLINE# verbose = 0 #NEWLINE# random = True #NEWLINE# print_ = False #NEWLINE# ones = False #NEWLINE# if ones : #NEWLINE# #INDENT# random = False #NEWLINE# #UNINDENT# global theano_mode #NEWLINE# theano_mode_orig = theano_mode #NEWLINE# try : #NEWLINE# #INDENT# if ( theano . config . mode in [ 'DebugMode' , 'DEBUG_MODE' ] ) : #NEWLINE# #INDENT# theano_mode = theano . compile . mode . get_mode ( 'FAST_RUN' ) . including ( 'gpu' ) #NEWLINE# for mode in [ 'valid' , 'full' ] : #NEWLINE# #INDENT# for shapes in [ ( ( 3 , 2 , 8 , 8 ) , ( 4 , 2 , 5 , 5 ) , ( 8 , 8 ) ) , ( ( 3 , 2 , 8 , 8 ) , ( 4 , 2 , 5 , 5 ) , ( 5 , 8 ) ) ] : #NEWLINE# #INDENT# self . assertRaises ( ValueError , _params_allgood , shapes [ 0 ] , shapes [ 1 ] , verbose = verbose , random = random , mode = random , print_ = print_ , ones = ones , compile_kshp = shapes [ 2 ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# theano_mode = theano_mode_orig