MCPcopy
hub / github.com/lllyasviel/Paints-UNDO / zero_module

Function zero_module

diffusers_vdm/basics.py:18–24  ·  view source on GitHub ↗

Zero out the parameters of a module and return it.

(module)

Source from the content-addressed store, hash-verified

16
17
18def zero_module(module):
19 """
20 Zero out the parameters of a module and return it.
21 """
22 for p in module.parameters():
23 p.detach().zero_()
24 return module
25
26def scale_module(module, scale):
27 """

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