MCPcopy Create free account
hub / github.com/Gadersd/stable-diffusion-burn / save_group_norm

Function save_group_norm

python/save.py:29–37  ·  view source on GitHub ↗
(layer_norm, path)

Source from the content-addressed store, hash-verified

27 save_scalar(layer_norm.eps, 'eps', path)
28
29def save_group_norm(layer_norm, path):
30 pathlib.Path(path).mkdir(parents=True, exist_ok=True)
31 if layer_norm.weight is not None:
32 save_tensor(layer_norm.weight, 'weight', path)
33 if layer_norm.bias is not None:
34 save_tensor(layer_norm.bias, 'bias', path)
35 save_scalar(layer_norm.eps, 'eps', path)
36 save_scalar(layer_norm.num_groups, 'n_group', path)
37 save_scalar(layer_norm.num_channels, 'n_channel', path)
38
39def to_tuple_tensor(val):
40 if isinstance(val, tuple):

Callers 7

save_res_blockFunction · 0.85
save_spatial_transformerFunction · 0.85
save_unet_modelFunction · 0.85
save_resnet_blockFunction · 0.85
save_attn_blockFunction · 0.85
save_decoderFunction · 0.85
save_encoderFunction · 0.85

Calls 2

save_tensorFunction · 0.85
save_scalarFunction · 0.85

Tested by

no test coverage detected