@@ -125,10 +125,10 @@ def _node_to_assign_st(self, node):
125125 # `value is str` doesn't work
126126 # TODO: BOOLEAN, not used in any node?
127127 if type (value ) is str :
128- args [name ] = {'exp' : astutil .to_str (value )}
128+ args [name ] = {'exp' : astutil .to_str (value ), 'value' : value }
129129 else :
130130 # int, float
131- args [name ] = {'exp' : str (value )}
131+ args [name ] = {'exp' : str (value ), 'value' : value }
132132 if hasattr (v , 'inputs' ):
133133 # If a node's output is not used, it is allowed to have dangling inputs, in which case the link is None.
134134 # TODO: This breaks the order and arg positions.
@@ -149,7 +149,8 @@ def _node_to_assign_st(self, node):
149149 'type' : input .type ,
150150 'move' : output_links is None or len (output_links ) == 1
151151 }
152- args = self ._keyword_args_to_positional (v .type , args )
152+ args_dict = args
153+ args = self ._keyword_args_to_positional (v .type , args_dict )
153154
154155 args_of_any_type = [arg for arg in args if arg .get ('type' , None ) == '*' ]
155156
@@ -209,6 +210,7 @@ def _node_to_assign_st(self, node):
209210
210211 c = passes .reroute_elimination (v , args , vars , c )
211212 c = passes .primitive_node_elimination (v , args , vars , c )
213+ c = passes .switch_node_elimination (v , args_dict , args , vars , c )
212214 return c
213215
214216 def _topological_generations_ordered_dfs (self , end_nodes : Union [list [int ], None ] = None ):
0 commit comments