MCPcopy Create free account
hub / github.com/Sin3DM/Sin3DM / zero_module

Function zero_module

src/encoding/blocks.py:99–105  ·  view source on GitHub ↗

Zero out the parameters of a module and return it.

(module)

Source from the content-addressed store, hash-verified

97
98
99def zero_module(module):
100 """
101 Zero out the parameters of a module and return it.
102 """
103 for p in module.parameters():
104 p.detach().zero_()
105 return module
106
107
108class ResnetBlock(nn.Module):

Callers 2

__init__Method · 0.70
__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected