MCPcopy
hub / github.com/openai/guided-diffusion / zero_module

Function zero_module

guided_diffusion/nn.py:68–74  ·  view source on GitHub ↗

Zero out the parameters of a module and return it.

(module)

Source from the content-addressed store, hash-verified

66
67
68def zero_module(module):
69 """
70 Zero out the parameters of a module and return it.
71 """
72 for p in module.parameters():
73 p.detach().zero_()
74 return module
75
76
77def scale_module(module, scale):

Callers 4

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected