docstr: 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.
docstr_tok: ["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","."]
code: 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 = {}
  
imports: import gc
  import numpy
  import math
  import json
  import time
  from .summary import compute_curve
  from .utils import figure_to_image
  from .x2num import make_np
label_desc: Use image node_id 5 for calling the VisdomWriter obj's underlying member method code with example usage: obj.export_scalars_to_json(path) without return types