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

Function count_param

diffportrait360_release/code/utils/utils.py:32–33  ·  view source on GitHub ↗
(module_list)

Source from the content-addressed store, hash-verified

30
31# count # of param for a list of module
32def count_param(module_list):
33 return sum(x.numel() for module in module_list for x in module.parameters()) / 10**6
34
35# display the peak memory of cuda
36def print_peak_memory(prefix, device):

Callers 3

mainFunction · 0.90
mainFunction · 0.90
mainFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected