MCPcopy
hub / github.com/JaidedAI/EasyOCR / copyStateDict

Function copyStateDict

trainer/craft/utils/util.py:11–20  ·  view source on GitHub ↗
(state_dict)

Source from the content-addressed store, hash-verified

9
10
11def copyStateDict(state_dict):
12 if list(state_dict.keys())[0].startswith("module"):
13 start_idx = 1
14 else:
15 start_idx = 0
16 new_state_dict = OrderedDict()
17 for k, v in state_dict.items():
18 name = ".".join(k.split(".")[start_idx:])
19 new_state_dict[name] = v
20 return new_state_dict
21
22
23def saveInput(

Callers 4

main_evalFunction · 0.90
trainMethod · 0.90
trainMethod · 0.90
trainMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…