#NEWLINE# def __init__( self , inputs , outputs , **kwargs ) : #NEWLINE# #INDENT# if ( not isinstance ( outputs , list ) ) : #NEWLINE# #INDENT# raise TypeError ( 'outputs must be list' , outputs ) #NEWLINE# #UNINDENT# for i in ( inputs + outputs ) : #NEWLINE# #INDENT# if ( not isinstance ( i , gof . Variable ) ) : #NEWLINE# #INDENT# raise TypeError ( 'inputs and outputs must be Variable instances' , i ) #NEWLINE# #UNINDENT# #UNINDENT# if ( ( 'updates' in kwargs ) or ( 'givens' in kwargs ) ) : #NEWLINE# #INDENT# raise TypeError ( 'updates and givens are not allowed in kwargs' ) #NEWLINE# #UNINDENT# self . shared_inputs = [ var for var in gof . graph . inputs ( outputs ) if isinstance ( var , SharedVariable ) ] #NEWLINE# shared_vars = [ var . type ( ) for var in self . shared_inputs ] #NEWLINE# new = rebuild_collect_shared ( outputs , inputs = ( inputs + shared_vars ) , replace = dict ( izip ( input . shared_inputs , shared_vars ) ) , copy_inputs_over = False ) #NEWLINE# ( new_inputs , new_outputs , [ clone_d , update_d , update_expr , shared_inputs ] ) = new #NEWLINE# assert ( len ( new_inputs ) == ( len ( inputs ) + len ( self . shared_inputs ) ) ) #NEWLINE# assert ( len ( new_outputs ) == len ( outputs ) ) #NEWLINE# assert ( not update_d ) #NEWLINE# assert ( not update_expr ) #NEWLINE# assert ( not shared_inputs ) #NEWLINE# self . new_inputs = new_inputs #NEWLINE# self . new_outputs = new_outputs #NEWLINE# self . inputs = inputs #NEWLINE# self . outputs = outputs #NEWLINE# self . kwargs = kwargs #NEWLINE# self . input_types = [ input . type for input in inputs ] #NEWLINE# self . output_types = [ output . type for output in outputs ]