MCPcopy Create free account
hub / github.com/FreedomGu/Diffportrait360 / print_peak_memory

Function print_peak_memory

diffportrait360_release/code/utils/utils.py:36–38  ·  view source on GitHub ↗
(prefix, device)

Source from the content-addressed store, hash-verified

34
35# display the peak memory of cuda
36def print_peak_memory(prefix, device):
37 if device == 0:
38 print(f"{prefix}: {torch.cuda.max_memory_allocated(device) // 1e6}MB ")
39
40def anal_tensor(tensor, name):
41 sent = f" name: {name} mean: {tensor.mean().item()} std: {tensor.std().item()} min: {tensor.min().item()} max: {tensor.max().item()}"

Callers 3

mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected