MCPcopy Index your code
hub / github.com/microsoft/TRELLIS / zero_module

Function zero_module

trellis/modules/utils.py:35–41  ·  view source on GitHub ↗

Zero out the parameters of a module and return it.

(module)

Source from the content-addressed store, hash-verified

33
34
35def zero_module(module):
36 """
37 Zero out the parameters of a module and return it.
38 """
39 for p in module.parameters():
40 p.detach().zero_()
41 return module
42
43
44def scale_module(module, scale):

Callers 3

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls 1

detachMethod · 0.80

Tested by

no test coverage detected