MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / find_replace

Function find_replace

deepspeed/autotuning/utils.py:59–71  ·  view source on GitHub ↗
(target, replace_dict)

Source from the content-addressed store, hash-verified

57
58
59def find_replace(target, replace_dict):
60 if isinstance(target, dict):
61 for key, value in target.items():
62 if isinstance(value, str):
63 target[key] = find_replace_str(value, replace_dict)
64 if isinstance(value, list):
65 for i in range(len(value)):
66 value[i] = find_replace_str(value[i], replace_dict)
67 if isinstance(value, dict):
68 find_replace(value, replace_dict)
69 elif isinstance(target, list):
70 for i in range(len(target)):
71 target[i] = str(find_replace_str(target[i], replace_dict))
72
73
74def get_list(val):

Callers

nothing calls this directly

Calls 1

find_replace_strFunction · 0.85

Tested by

no test coverage detected