Skip to content

Commit

Permalink
Modify debug_all_outputs.py (#204)
Browse files Browse the repository at this point in the history
* debug all outputs python script doesn't debug final outputs anymore

* update onnx example model

* add link to onnx standard motivating omitting final graph output debug operators
  • Loading branch information
Ori Levari authored Mar 27, 2019
1 parent 796e4f9 commit 148a113
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ def create_modified_model(args):
for output in node.output:
intermediate_outputs.add(output)

# remove final graph outputs (see the definition of graph outputs in the onnx standard: https://github.com/onnx/onnx/blob/master/docs/IR.md#user-content-graphs)
# it would be invalid to add debug operators after the final graph outputs since execution must be finished once all outputs are written to
for output in model.graph.output:
intermediate_outputs.remove(output.name)

# create a debug operator that consumes each intermediate output
# debug operator file path attribute is constructed by the name of the intermediate output
for output in intermediate_outputs:
Expand Down

0 comments on commit 148a113

Please sign in to comment.