#NEWLINE# def test_remove_inplace( self ) : #NEWLINE# #INDENT# mySymbolicMatricesList = TypedListType ( T . TensorType ( theano . config . floatX , ( False , False ) ) ) ( ) #NEWLINE# mySymbolicMatrix = T . matrix ( ) #NEWLINE# z = Remove ( ) ( mySymbolicMatricesList , mySymbolicMatrix ) #NEWLINE# m = theano . compile . mode . get_default_mode ( ) . including ( 'typed_list_inplace_opt' ) #NEWLINE# f = theano . function ( [ In ( mySymbolicMatricesList , borrow = True , mutable = True ) , In ( mySymbolicMatrix , borrow = True , mutable = True ) ] , z , accept_inplace = True , mode = m ) #NEWLINE# self . assertTrue ( f . maker . fgraph . toposort ( ) [ 0 ] . op . inplace ) #NEWLINE# x = rand_ranged_matrix ( ( - 1000 ) , 1000 , [ 100 , 101 ] ) #NEWLINE# y = rand_ranged_matrix ( ( - 1000 ) , 1000 , [ 100 , 101 ] ) #NEWLINE# self . assertTrue ( numpy . array_equal ( f ( [ x , y ] , y ) , [ x ] ) )