Skip to content

How to check what operators are being used by a model #356

Answered by jstoecker
vt911001 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey Vincent,

The easiest way to find out where ops are placed is by using log_device_placement in a tf.ConfigProto. Some more details here. However, this option can be misleading because it's telling you the placement of ops in the model before it gets optimized: for example, ops may be fused together or eliminated entirely because they can be evaluated statically (constant folding). Regardless, this tool tells you the intended device to execute each op.

If you want to know the ops that get executed after the model's graph is optimized then you have to trace each execution. For example, you can trace a single session.run for training to collect stats. The tf.RunOptions object exposes two …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@vt911001
Comment options

Answer selected by vt911001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants