MCPcopy
hub / github.com/ali-vilab/AnyDoor / zero_module

Function zero_module

ldm/modules/diffusionmodules/util.py:177–183  ·  view source on GitHub ↗

Zero out the parameters of a module and return it.

(module)

Source from the content-addressed store, hash-verified

175
176
177def zero_module(module):
178 """
179 Zero out the parameters of a module and return it.
180 """
181 for p in module.parameters():
182 p.detach().zero_()
183 return module
184
185
186def scale_module(module, scale):

Callers 5

__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
__init__Method · 0.90
make_zero_convMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected