MCPcopy Create free account
hub / github.com/OpenImagingLab/FlashVSR / search_parameter

Function search_parameter

diffsynth/models/utils.py:101–110  ·  view source on GitHub ↗
(param, state_dict)

Source from the content-addressed store, hash-verified

99
100
101def search_parameter(param, state_dict):
102 for name, param_ in state_dict.items():
103 if param.numel() == param_.numel():
104 if param.shape == param_.shape:
105 if torch.dist(param, param_) < 1e-3:
106 return name
107 else:
108 if torch.dist(param.flatten(), param_.flatten()) < 1e-3:
109 return name
110 return None
111
112
113def build_rename_dict(source_state_dict, target_state_dict, split_qkv=False):

Callers 1

build_rename_dictFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected