|TensorFlow 1 version||View source on GitHub|
Write a text summary.
tf.summary.text( name, data, step=None, description=None )
Used in the notebooks
|Used in the tutorials|
Writes text Tensor values for later visualization and analysis in TensorBoard.
Writes go to the current default summary writer. Like
points, text points are each associated with a
step and a
All the points with the same
name constitute a time series of text values.
test_summary_writer = tf.summary.create_file_writer('test/logdir') with test_summary_writer.as_default(): tf.summary.text('first_text', 'hello world!', step=0) tf.summary.text('first_text', 'nice to meet you!', step=1)
The text summary can also contain Markdown, and TensorBoard will render the text as such.
with test_summary_writer.as_default(): text_data = ''' | *hello* | *there* | |---------|---------| | this | is | | a | table | ''' text_data = '\n'.join(l.strip() for l in text_data.splitlines()) tf.summary.text('markdown_text', text_data, step=0)
Since text is Tensor valued, each text point may be a Tensor of string values. rank-1 and rank-2 Tensors are rendered as tables in TensorBoard. For higher ranked Tensors, you'll see just a 2D slice of the data. To avoid this, reshape the Tensor to at most rank-2 prior to passing it to this function.
Demo notebook at "Displaying text data in TensorBoard".
||A name for this summary. The summary tag used for TensorBoard will be this name prefixed by any active name scopes.|
||A UTF-8 string Tensor value.|
Optional long-form description for this summary, as a
|True on success, or false if no summary was emitted because no default summary writer was available.|
if a default writer exists, but no step was provided and