| 59 | return self.dot |
| 60 | |
| 61 | def get_node(self, node_list): |
| 62 | for py_op_wrapper in self.py_op_wrapper_list: |
| 63 | op_wrapper = py_op_wrapper.GetOpWrapper() |
| 64 | # TODO: multi output |
| 65 | for i in range(op_wrapper.GetOpConfig()["numOfOutputs"]): |
| 66 | if op_wrapper.GetOpConfig()["outputTensors"][0].version == 2: |
| 67 | node = op_wrapper.GetOpConfig()["outputTensors"][i].v2 |
| 68 | node_name = node.name |
| 69 | input_list = [] |
| 70 | for j in range(op_wrapper.GetOpConfig()["numOfInputs"]): |
| 71 | if op_wrapper.GetOpConfig()["inputTensors"][j].version == 2: |
| 72 | input_node = op_wrapper.GetOpConfig()["inputTensors"][j].v2 |
| 73 | input_node_name = input_node.name |
| 74 | if input_node_name not in node_list: |
| 75 | node_list[input_node_name] = { |
| 76 | "node": input_node, |
| 77 | "input_list": [], |
| 78 | } |
| 79 | input_list.append(input_node_name) |
| 80 | else: |
| 81 | raise ValueError("Unsupported tensor version") |
| 82 | if node_name not in node_list: |
| 83 | node_list[node_name] = {"node": node, "input_list": input_list} |
| 84 | else: |
| 85 | node_list[node_name]["input_list"] = input_list |
| 86 | else: |
| 87 | raise ValueError("Unsupported tensor version") |
| 88 | |
| 89 | def add_node(self, node_list, excel_data): |
| 90 | for node_name, tensor in node_list.items(): |