Ejemplo n.º 1
0
 def _make_stats(self, stats_dict):
     stats = wandb_internal_pb2.StatsRecord()
     stats.stats_type = wandb_internal_pb2.StatsRecord.StatsType.SYSTEM
     stats.timestamp.GetCurrentTime()
     for k, v in six.iteritems(stats_dict):
         item = stats.item.add()
         item.key = k
         item.value_json = json_dumps_safer(json_friendly(v)[0])
     return stats
Ejemplo n.º 2
0
 def _make_stats(self, stats_dict: dict) -> pb.StatsRecord:
     stats = pb.StatsRecord()
     stats.stats_type = pb.StatsRecord.StatsType.SYSTEM
     stats.timestamp.GetCurrentTime()
     for k, v in six.iteritems(stats_dict):
         item = stats.item.add()
         item.key = k
         item.value_json = json_dumps_safer(json_friendly(v)[0])  # type: ignore
     return stats