MCPcopy Create free account
hub / github.com/pytorch/pytorch / log_metrics

Method log_metrics

caffe2/python/parallel_workers.py:95–102  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

93 self._metrics = collections.defaultdict(lambda: 0)
94
95 def log_metrics(self):
96 if not self._external_loggers:
97 return
98 for logger in self._external_loggers:
99 try:
100 logger.log(self._metrics)
101 except Exception as e:
102 print("Failed to call ExternalLogger: {}".format(e))
103
104 def put_metric(self, key, value, count=True):
105 self._metrics[key] += value

Callers 2

finishMethod · 0.80

Calls 2

logMethod · 0.45
formatMethod · 0.45

Tested by

no test coverage detected