#NEWLINE# def test_elemwise_bad_broadcast( ) : #NEWLINE# #INDENT# x = cuda . fmatrix ( 'x' ) #NEWLINE# y = cuda . fmatrix ( 'y' ) #NEWLINE# f = theano . function ( [ x , y ] , ( x * y ) , mode = mode_with_gpu ) #NEWLINE# assert ( len ( f . maker . fgraph . toposort ( ) ) == 2 ) #NEWLINE# assert isinstance ( f . maker . fgraph . toposort ( ) [ 0 ] . op , cuda . GpuElemwise ) #NEWLINE# assert ( f . maker . fgraph . toposort ( ) [ 1 ] . op == cuda . host_from_gpu ) #NEWLINE# try : #NEWLINE# #INDENT# f ( rand_cuda_ndarray ( ( 10 , 3 ) ) , rand_cuda_ndarray ( ( 10 , 1 ) ) ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Exception ( 'Theano should have raised an error' )