Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added add_text_dict() function to Summarywriter... #167

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions tensorboardX/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,25 @@ def add_text(self, tag, text_string, global_step=None):
"""
self.file_writer.add_summary(text(tag, text_string), global_step)

def add_text_dict(self, tag, d, global_step=None):
"""Add dictionary as text to summary.

Args:
tag (string): Data identifier
d (dictionary): Key value pairs to print
global_step (int): Global step value to record

Examples::

writer.add_text('parameters', params, 0)
"""

text_string = ""
for key, value in d.items():
text_string += "\t" + str(key) + ": " + str(value) + "\n"

self.file_writer.add_summary(text(tag, text_string), global_step)

def add_graph_onnx(self, prototxt):
self.file_writer.add_graph_onnx(gg(prototxt))

Expand Down