Created
December 8, 2016 22:51
-
-
Save yaroslavvb/b0b9e51d88bb97aa0f739f8130e1c3d5 to your computer and use it in GitHub Desktop.
Example of using stats summarizer
This file contains hidden or 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
import tensorflow as tf | |
a = tf.ones((10, 10)) | |
b = tf.ones((10, 10)) | |
c = tf.matmul(a, b) | |
ss = tf.contrib.stat_summarizer.NewStatSummarizer(tf.get_default_graph().as_graph_def().SerializeToString()) | |
sess = tf.Session() | |
for i in range(10): | |
run_metadata = tf.RunMetadata() | |
run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE) | |
sess.run(c, options=run_options, run_metadata=run_metadata) | |
ss.ProcessStepStatsStr(run_metadata.step_stats.SerializeToString()) | |
print(ss.GetOutputString()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment