MCPcopy Create free account
hub / github.com/XiaoMi/mace / generate_in_out_map

Function generate_in_out_map

tools/python/encrypt.py:57–75  ·  view source on GitHub ↗
(ops, tensor_map, model_names_set)

Source from the content-addressed store, hash-verified

55
56
57def generate_in_out_map(ops, tensor_map, model_names_set):
58 in_out_map = {}
59 for op in ops:
60 op.name = generate_obfuscated_name("op", op.name, model_names_set)
61 for input_name in op.input:
62 if input_name not in in_out_map:
63 if input_name in tensor_map:
64 in_out_map[input_name] = tensor_map[input_name]
65 else:
66 in_out_map[input_name] = generate_obfuscated_name(
67 "in", input_name, model_names_set)
68 for output_name in op.output:
69 if output_name not in in_out_map:
70 if output_name in tensor_map:
71 in_out_map[output_name] = tensor_map[output_name]
72 else:
73 in_out_map[output_name] = generate_obfuscated_name(
74 "out", output_name, model_names_set)
75 return in_out_map
76
77
78def stringfy(value):

Callers 1

obfuscate_nameFunction · 0.85

Calls 1

generate_obfuscated_nameFunction · 0.85

Tested by

no test coverage detected