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

Function zero_init

k_diffusion/models/modules.py:41–45  ·  view source on GitHub ↗
(layer)

Source from the content-addressed store, hash-verified

39 return x * (1 + scale.unsqueeze(1).unsqueeze(1)) + shift.unsqueeze(1).unsqueeze(1)
40
41def zero_init(layer):
42 nn.init.zeros_(layer.weight)
43 if layer.bias is not None:
44 nn.init.zeros_(layer.bias)
45 return layer
46
47
48def checkpoint(function, *args, **kwargs):

Callers 6

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected