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

Function save_encoder_block

python/autoencoder.py:62–70  ·  view source on GitHub ↗
(encoder_block, path)

Source from the content-addressed store, hash-verified

60 save_conv2d(decoder.conv_out, pathlib.Path(path, 'conv_out'))
61
62def save_encoder_block(encoder_block, path):
63 pathlib.Path(path).mkdir(parents=True, exist_ok=True)
64
65 if 'block' in encoder_block:
66 save_resnet_block(encoder_block["block"][0], pathlib.Path(path, 'res1'))
67 save_resnet_block(encoder_block["block"][1], pathlib.Path(path, 'res2'))
68
69 if 'downsample' in encoder_block:
70 save_padded_conv2d(encoder_block['downsample']['conv'], pathlib.Path(path, 'downsampler'))
71
72def save_encoder(encoder, path):
73 pathlib.Path(path).mkdir(parents=True, exist_ok=True)

Callers 1

save_encoderFunction · 0.85

Calls 2

save_resnet_blockFunction · 0.85
save_padded_conv2dFunction · 0.85

Tested by

no test coverage detected