Skip to content

Instantly share code, notes, and snippets.

@helinwang
Created February 16, 2018 23:03
Show Gist options
  • Save helinwang/d4ad4575356a85d9079fcb204032da00 to your computer and use it in GitHub Desktop.
Save helinwang/d4ad4575356a85d9079fcb204032da00 to your computer and use it in GitHub Desktop.
Print PaddlePaddle Operators and Blocks
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)
@tonyyang-svail
Copy link

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment