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

Function write_graph

tensorflow/compiler/aot/tests/make_test_graphs.py:172–179  ·  view source on GitHub ↗

Build a graph using build_graph and write it out.

(build_graph, out_dir)

Source from the content-addressed store, hash-verified

170
171
172def write_graph(build_graph, out_dir):
173 """Build a graph using build_graph and write it out."""
174 g = ops.Graph()
175 with g.as_default():
176 build_graph(out_dir)
177 filename = os.path.join(out_dir, 'test_graph_%s.pb' % build_graph.__name__)
178 with open(filename, 'wb') as f:
179 f.write(g.as_graph_def().SerializeToString())
180
181
182def main(_):

Callers 1

mainFunction · 0.70

Calls 7

as_defaultMethod · 0.95
as_graph_defMethod · 0.95
build_graphFunction · 0.50
GraphMethod · 0.45
joinMethod · 0.45
writeMethod · 0.45
SerializeToStringMethod · 0.45

Tested by

no test coverage detected