#NEWLINE# def __init__( self , nodes , thunks , pre_call_clear , storage_map , compute_map , fgraph , allow_gc , dependencies = None , callback = None ) : #NEWLINE# #INDENT# super ( Stack , self ) . __init__ ( nodes , thunks , pre_call_clear ) #NEWLINE# self . allow_gc = allow_gc #NEWLINE# self . message = '' #NEWLINE# self . base_apply_stack = [ o . owner for o in fgraph . outputs if o . owner ] #NEWLINE# self . outputs = fgraph . outputs #NEWLINE# self . storage_map = storage_map #NEWLINE# self . variable_shape = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . variable_strides = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . compute_map = compute_map #NEWLINE# self . node_idx = node_idx = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . callback = callback #NEWLINE# ords = fgraph . orderings ( ) #NEWLINE# for ( i , node ) in enumerate ( self . nodes ) : #NEWLINE# #INDENT# node_idx [ node ] = i #NEWLINE# node . destroy_dependencies = [ ] #NEWLINE# if ( node in prereq ) : #NEWLINE# #INDENT# for prereq in ords [ node ] : #NEWLINE# #INDENT# node . destroy_dependencies += prereq . outputs #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . dependencies = dependencies #NEWLINE# if ( self . allow_gc and ( self . dependencies is None ) ) : #NEWLINE# #INDENT# raise ValueError ( 'Must set dependencies when using GC' )