Skip to content

Commit df08059

Browse files
authored
Merge pull request #427 from pengwa/add_update_proto
add update_proto() before return Graph to users
2 parents 343affe + 2938d65 commit df08059

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

tf2onnx/graph.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def name(self):
105105

106106
@property
107107
def op(self):
108+
"""TODO: have a better interface for this."""
108109
return self._op
109110

110111
@property

tf2onnx/optimizer/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def optimize_graph(graph, debug=False):
3131
opts = _get_optimizers()
3232
for opt in opts.values():
3333
graph = opt(debug=debug).optimize(graph)
34+
35+
graph.update_proto()
3436
return graph
3537
except Exception:
3638
# degradation to non-optimized model proto

tf2onnx/tfonnx.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2568,6 +2568,8 @@ def process_tf_graph(tf_graph, continue_on_error=False, verbose=False, target=No
25682568
# onnx requires topological sorting
25692569
topological_sort(g, continue_on_error)
25702570

2571+
g.update_proto()
2572+
25712573
if verbose:
25722574
print("tensorflow ops: {}".format(op_cnt))
25732575
print("tensorflow attr: {}".format(attr_cnt))

0 commit comments

Comments
 (0)