| 150 | ) |
| 151 | |
| 152 | def to_excel(self, excel_data): |
| 153 | param_rows = [] |
| 154 | activation_rows = [] |
| 155 | |
| 156 | for entry in excel_data: |
| 157 | name = entry["name"] |
| 158 | scale = entry["scale"] |
| 159 | offset = entry["offset"] |
| 160 | if ( |
| 161 | entry["tensor_type"] |
| 162 | == PyQnnManager.Qnn_TensorType_t.QNN_TENSOR_TYPE_STATIC |
| 163 | ): |
| 164 | param_rows.append({"name": name, "scale": scale, "offset": offset}) |
| 165 | else: |
| 166 | activation_rows.append({"name": name, "scale": scale, "offset": offset}) |
| 167 | param_df = pd.DataFrame(param_rows) |
| 168 | scale_df = pd.DataFrame(activation_rows) |
| 169 | output_file = f"{self.filename}.xlsx" |
| 170 | |
| 171 | with pd.ExcelWriter(output_file) as writer: |
| 172 | param_df.to_excel(writer, sheet_name="Parameters", index=False) |
| 173 | scale_df.to_excel(writer, sheet_name="Scales", index=False) |
| 174 | |
| 175 | def draw(self): |
| 176 | graph = self.get_dot_graph() |