#NEWLINE# def test_extend_inplace( self ) : #NEWLINE# #INDENT# mySymbolicMatricesList1 = TypedListType ( T . TensorType ( theano . config . floatX , ( False , False ) ) ) ( ) #NEWLINE# mySymbolicMatricesList2 = TypedListType ( T . TensorType ( theano . config . floatX , ( False , False ) ) ) ( ) #NEWLINE# z = Extend ( ) ( mySymbolicMatricesList1 , mySymbolicMatricesList2 ) #NEWLINE# m = theano . compile . mode . get_default_mode ( ) . including ( 'typed_list_inplace_opt' ) #NEWLINE# f = theano . function ( [ In ( mySymbolicMatricesList1 , borrow = True , mutable = True ) , mySymbolicMatricesList2 ] , z , 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 ( [ mySymbolicMatricesList2 ] , [ y ] ) , [ x , y ] ) )