MCPcopy
hub / github.com/zai-org/CogVideo / zero_module

Function zero_module

sat/sgm/modules/diffusionmodules/util.py:203–209  ·  view source on GitHub ↗

Zero out the parameters of a module and return it.

(module)

Source from the content-addressed store, hash-verified

201
202
203def zero_module(module):
204 """
205 Zero out the parameters of a module and return it.
206 """
207 for p in module.parameters():
208 p.detach().zero_()
209 return module
210
211
212def scale_module(module, scale):

Callers 4

__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.70
__init__Method · 0.70

Calls 1

parametersMethod · 0.80

Tested by

no test coverage detected