MCPcopy Create free account
hub / github.com/MotrixLab/FineMoGen / zero_module

Function zero_module

mogen/models/utils/misc.py:17–23  ·  view source on GitHub ↗

Zero out the parameters of a module and return it.

(module)

Source from the content-addressed store, hash-verified

15
16
17def zero_module(module):
18 """
19 Zero out the parameters of a module and return it.
20 """
21 for p in module.parameters():
22 p.detach().zero_()
23 return module

Callers 5

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected