mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-08 10:47:32 +08:00
Refactor module_size function.
This commit is contained in:
parent
d1b9822f74
commit
1a30002a41
@ -456,7 +456,7 @@ def module_size(module):
|
|||||||
sd = module.state_dict()
|
sd = module.state_dict()
|
||||||
for k in sd:
|
for k in sd:
|
||||||
t = sd[k]
|
t = sd[k]
|
||||||
module_mem += t.nelement() * t.element_size()
|
module_mem += t.nbytes
|
||||||
return module_mem
|
return module_mem
|
||||||
|
|
||||||
class LoadedModel:
|
class LoadedModel:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user