#NEWLINE# def test_merge_with_weird_eq( ) : #NEWLINE# #INDENT# "numpy arrays don't compare equal like other python objects" #NEWLINE# x = T . constant ( numpy . asarray ( 1 ) , name = 'x' ) #NEWLINE# y = T . constant ( numpy . asarray ( 1 ) , name = 'y' ) #NEWLINE# g = Env ( [ x , y ] , [ ( x + y ) ] ) #NEWLINE# MergeOptimizer ( ) . optimize ( g ) #NEWLINE# assert ( len ( g . apply_nodes ) == 1 ) #NEWLINE# node = list ( g . apply_nodes ) [ 0 ] #NEWLINE# assert ( len ( node . inputs ) == 2 ) #NEWLINE# assert ( node . inputs [ 0 ] is node . inputs [ 1 ] ) #NEWLINE# x = T . constant ( numpy . ones ( 5 ) , name = 'x' ) #NEWLINE# y = T . constant ( numpy . ones ( 5 ) , name = 'y' ) #NEWLINE# g = Env ( [ x , y ] , [ ( x + y ) ] ) #NEWLINE# MergeOptimizer ( ) . optimize ( g ) #NEWLINE# assert ( len ( g . apply_nodes ) == 1 ) #NEWLINE# node = list ( g . apply_nodes ) [ 0 ] #NEWLINE# assert ( len ( node . inputs ) == 2 ) #NEWLINE# assert ( node . inputs [ 0 ] is node . inputs [ 1 ] )