docstr: Adds a json dict of metrics.
  
  >> e.log({"loss": 23, "coeff_a": 0.2})
  
  :param metrics_dict:
  :tag optional tfx tag
  :return:
docstr_tok: ["Adds","a","json","dict","of","metrics",".",">",">","e.log","(","{","``","loss","''",":","23",",","``","coeff_a","''",":","0.2","}",")",":","param","metrics_dict",":",":","tag","optional","tfx","tag",":","return",":"]
code: def log(self, metrics_dict, global_step=None, walltime=None):
      """
      Adds a json dict of metrics.
  
      >> e.log({"loss": 23, "coeff_a": 0.2})
  
      :param metrics_dict:
      :tag optional tfx tag
      :return:
      """
      if self.debug or self.rank > 0:
          return
  
      # handle tfx metrics
      if global_step is None:
          global_step = len(self.metrics)
  
      new_metrics_dict = metrics_dict.copy()
      for k, v in metrics_dict.items():
          if isinstance(v, dict):
              self.add_scalars(
                  main_tag=k,
                  tag_scalar_dict=v,
                  global_step=global_step,
                  walltime=walltime,
              )
              tmp_metrics_dict = new_metrics_dict.pop(k)
              new_metrics_dict.update(tmp_metrics_dict)
          else:
              self.add_scalar(
                  tag=k,
                  scalar_value=v,
                  global_step=global_step,
                  walltime=walltime,
              )
  
      metrics_dict = new_metrics_dict
  
      # timestamp
      if "created_at" not in metrics_dict:
          metrics_dict["created_at"] = str(datetime.utcnow())
  
      self.__convert_numpy_types(metrics_dict)
  
      self.metrics.append(metrics_dict)
  
      if self.autosave:
          self.save()
  
imports: import contextlib
  import json
  import os
  import shutil
  from datetime import datetime
  import numpy
  import pandas
  from imageio import imwrite
  from tensorboard.compat.proto.event_pb2 import Event
  from tensorboard.compat.proto.event_pb2 import SessionLog
  from torch.utils.tensorboard import SummaryWriter, FileWriter
label_desc: Use image node_id 12 for calling the Experiment obj's underlying member method code with example usage: obj.log(metrics_dict, global_step, walltime) without return types