MCPcopy Create free account
hub / github.com/MARIO-Math-Reasoning/Super_MARIO / prune_node

Function prune_node

offline_inference.py:94–105  ·  view source on GitHub ↗
(node: Type[InferNode])

Source from the content-addressed store, hash-verified

92
93
94def prune_node(node: Type[InferNode]) -> bool:
95 if node.children:
96 children_prune = []
97 for child in node.children:
98 children_prune.append(prune_node(child))
99 if all(children_prune):
100 node.prune = True
101 else:
102 # for leaf node
103 if not is_valid_final_answer_node(node):
104 node.prune = True
105 return node.prune
106
107
108def select_non_prune(current_nodes: List[Type[InferNode]]) -> List[Type[InferNode]]:

Callers 1

get_solutionFunction · 0.85

Calls 1

Tested by

no test coverage detected