MCPcopy Create free account
hub / github.com/Vchitect/SEINE / zero_module

Function zero_module

models/utils.py:97–103  ·  view source on GitHub ↗

Zero out the parameters of a module and return it.

(module)

Source from the content-addressed store, hash-verified

95
96
97def zero_module(module):
98 """
99 Zero out the parameters of a module and return it.
100 """
101 for p in module.parameters():
102 p.detach().zero_()
103 return module
104
105
106def scale_module(module, scale):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected