code: def get_metrics(model: Model, total_loss: float, num_batches: int, reset: bool = False) -> Dict[str, float]:
      
      metrics = model.get_metrics(reset=reset)
      metrics["loss"] = float(total_loss / num_batches) if num_batches > 0 else 0.0
      return metrics
docs: Gets the metrics but sets ``"loss"`` to
      the total loss divided by the ``num_batches`` so that
      the ``"loss"`` metric is "average loss per batch".