Skip to content

Commit

Permalink
subsequent update for c9a84bc
Browse files Browse the repository at this point in the history
  • Loading branch information
lanpa committed Apr 13, 2018
1 parent c9a84bc commit 215ae6d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tensorboardX/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ def add_scalar(self, tag, scalar_value, global_step=None):
def add_scalars(self, main_tag, tag_scalar_dict, global_step=None):
"""Adds many scalar data to summary.
Note that this function also keeps logged scalars in memory. In extreme case it explodes your RAM.
Args:
tag (string): Data identifier
main_tag (string): The parent name for the tags
Expand Down Expand Up @@ -304,9 +306,12 @@ def export_scalars_to_json(self, path):
"""Exports to the given path an ASCII file containing all the scalars written
so far by this instance, with the following format:
{writer_id : [[timestamp, step, value], ...], ...}
The scalars saved by ``add_scalars()`` will be flushed after export.
"""
with open(path, "w") as f:
json.dump(self.scalar_dict, f)
self.scalar_dict = {}

def add_histogram(self, tag, values, global_step=None, bins='tensorflow'):
"""Add histogram to summary.
Expand Down

0 comments on commit 215ae6d

Please sign in to comment.