MCPcopy Create free account
hub / github.com/MotrixLab/FineMoGen / zero_module

Function zero_module

mogen/models/attentions/semantics_modulated.py:9–15  ·  view source on GitHub ↗

Zero out the parameters of a module and return it.

(module)

Source from the content-addressed store, hash-verified

7
8
9def zero_module(module):
10 """
11 Zero out the parameters of a module and return it.
12 """
13 for p in module.parameters():
14 p.detach().zero_()
15 return module
16
17
18@ATTENTIONS.register_module()

Callers 2

__init__Method · 0.70
__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected