Build a graph using build_graph and write it out.
(build_graph, out_dir)
| 170 | |
| 171 | |
| 172 | def 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 | |
| 182 | def main(_): |
no test coverage detected