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

Function modulate

k_diffusion/models/modules.py:38–39  ·  view source on GitHub ↗
(x, shift, scale)

Source from the content-addressed store, hash-verified

36# Helpers
37
38def modulate(x, shift, scale):
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)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected