MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / zero_module

Function zero_module

k_diffusion/models/attention.py:30–36  ·  view source on GitHub ↗

Zero out the parameters of a module and return it.

(module)

Source from the content-addressed store, hash-verified

28
29
30def zero_module(module):
31 """
32 Zero out the parameters of a module and return it.
33 """
34 for p in module.parameters():
35 p.detach().zero_()
36 return module
37
38
39def scale_for_cosine_sim(q, k, scale, eps):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected