(self, sp: Operation, ep: Operation)
| 203 | self.initialize_depth() |
| 204 | |
| 205 | def create_block(self, sp: Operation, ep: Operation) -> TrainableBlock: |
| 206 | if sp == ep: return TrainableBlock(sp=sp, ep=ep, rps=[sp]) |
| 207 | rps = self.search_engine.opset_matching( |
| 208 | sp_expr = lambda x: x == sp, |
| 209 | rp_expr = lambda x, y: True, |
| 210 | ep_expr = lambda x: x == ep, |
| 211 | direction='down') |
| 212 | rps = [(self.op_orders.index(op), op) for op in rps] |
| 213 | rps = sorted(rps) |
| 214 | return TrainableBlock(sp=sp, ep=ep, rps=[op for _, op in rps]) |
| 215 | |
| 216 | def build(self, op: Operation, limit: int) -> TrainableBlock: |
| 217 | """子图分割算法, 这个算法将从指定节点出发, 构造一个满足定义的子图结构 Solving best block from given |
no test coverage detected