MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / metrics_to_scalars

Method metrics_to_scalars

utils/pl_utils.py:945–956  ·  view source on GitHub ↗
(self, metrics)

Source from the content-addressed store, hash-verified

943 self.tqdm_metrics[k] = v
944
945 def metrics_to_scalars(self, metrics):
946 new_metrics = {}
947 for k, v in metrics.items():
948 if isinstance(v, torch.Tensor):
949 v = v.item()
950
951 if type(v) is dict:
952 v = self.metrics_to_scalars(v)
953
954 new_metrics[k] = v
955
956 return new_metrics
957
958 def process_output(self, output, train=False):
959 """Reduces output according to the training mode.

Callers 1

log_metricsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected