MCPcopy Create free account
hub / github.com/DPS2022/diffusion-posterior-sampling / scale_module

Function scale_module

guided_diffusion/nn.py:77–83  ·  view source on GitHub ↗

Scale the parameters of a module and return it.

(module, scale)

Source from the content-addressed store, hash-verified

75
76
77def scale_module(module, scale):
78 """
79 Scale the parameters of a module and return it.
80 """
81 for p in module.parameters():
82 p.detach().mul_(scale)
83 return module
84
85
86def mean_flat(tensor):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected