Created
February 16, 2018 23:03
-
-
Save helinwang/d4ad4575356a85d9079fcb204032da00 to your computer and use it in GitHub Desktop.
Print PaddlePaddle Operators and Blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def program_summary(program): | |
print("--------------------") | |
for block in program.blocks: | |
for op in block.ops: | |
outputs = [[x + ":"] + op.output(x) for x in op.output_names] | |
inputs = [[x + ":"] + op.input(x) for x in op.input_names] | |
print(block.idx, op.type, inputs, "|", outputs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice