(ops, tensor_map, model_names_set)
| 55 | |
| 56 | |
| 57 | def 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 | |
| 78 | def stringfy(value): |
no test coverage detected