MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / dismantle_func_graph

Function dismantle_func_graph

tensorflow/python/framework/func_graph.py:1174–1186  ·  view source on GitHub ↗

Removes reference cycles in `func_graph` FuncGraph. Helpful for making sure the garbage collector doesn't need to run when the FuncGraph goes out of scope, e.g. in tests using defun with @test_util.run_in_graph_and_eager_modes(assert_no_eager_garbage=True). Args: func_graph: A `FuncGra

(func_graph)

Source from the content-addressed store, hash-verified

1172
1173
1174def dismantle_func_graph(func_graph):
1175 """Removes reference cycles in `func_graph` FuncGraph.
1176
1177 Helpful for making sure the garbage collector doesn't need to run when
1178 the FuncGraph goes out of scope, e.g. in tests using defun with
1179 @test_util.run_in_graph_and_eager_modes(assert_no_eager_garbage=True).
1180
1181 Args:
1182 func_graph: A `FuncGraph` object to destroy. `func_graph` is unusable
1183 after this function.
1184 """
1185 func_graph.clear_captures()
1186 ops.dismantle_graph(func_graph)

Callers

nothing calls this directly

Calls 1

clear_capturesMethod · 0.80

Tested by

no test coverage detected