MCPcopy Create free account
hub / github.com/MaureenZOU/TSAM / transform

Function transform

src/scripts/FVI_checkpoint_compatibility_transform.py:58–65  ·  view source on GitHub ↗
(k, v)

Source from the content-addressed store, hash-verified

56 ]
57
58 def transform(k, v):
59 if any([k.startswith(name) for name in upsample_conv_names]):
60 out = ('generator.coarse_net.upsample_module.' + k, v)
61 elif any([k.startswith(name) for name in downsample_conv_names]):
62 out = ('generator.coarse_net.downsample_module.' + k, v)
63 else:
64 out = (k, v)
65 return out
66
67 new_state_dict = OrderedDict([
68 transform(k, v)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected