Skip to content

Instantly share code, notes, and snippets.

@Ademking
Created December 8, 2025 14:05
Show Gist options
  • Select an option

  • Save Ademking/73b31e63ee9d46b9c16622fb00e32b23 to your computer and use it in GitHub Desktop.

Select an option

Save Ademking/73b31e63ee9d46b9c16622fb00e32b23 to your computer and use it in GitHub Desktop.
averaged_metrics = {
metric: np.mean([v.cpu().detach().item() if hasattr(v, "cpu") else v for v in values])
for metric, values in metrics.items()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment