How do I add an arbitrary value to a TensorFlow summary?
<p>In order to log a simple value <code>val</code> to a TensorBoard summary I need to</p>

<pre><code>val = 5
test_writer.add_summary(sess.run(tf.scalar_summary('test', val)), global_step)
</code></pre>

<p>Is </p>

<pre><code>sess.run(tf.scalar_summary('test', val))
</code></pre>

<p>really necessary to get <code>val</code> added as a summary?</p>