MCPcopy Create free account
hub / github.com/MiniMax-AI/VTP / reduce_mean

Function reduce_mean

tools/test_reconstruction_hf.py:417–422  ·  view source on GitHub ↗
(values)

Source from the content-addressed store, hash-verified

415 # Aggregate metrics
416 if use_ddp:
417 def reduce_mean(values):
418 if not values:
419 return None
420 t = torch.tensor(np.mean(values), device=device)
421 dist.all_reduce(t, op=dist.ReduceOp.SUM)
422 return (t / world_size).item()
423
424 avg_lpips = reduce_mean(lpips_values)
425 avg_psnr = reduce_mean(psnr_values)

Callers 1

test_reconstructionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected