Copy ops without connecting them.
(self, info)
| 459 | return sgv_, res_info |
| 460 | |
| 461 | def _copy_ops(self, info): |
| 462 | """Copy ops without connecting them.""" |
| 463 | sorted_ops = sorted(info.sgv.ops, key=lambda op: op._id) # pylint: disable=protected-access |
| 464 | for op in sorted_ops: |
| 465 | new_inputs = [self._transformed_t(info, t, op) for t in op.inputs] |
| 466 | op_, op_outputs_ = self.transform_op_handler(info, op, new_inputs) |
| 467 | if op is op_: |
| 468 | raise ValueError("In-place transformation not allowed.") |
| 469 | |
| 470 | # Process op. |
| 471 | info.transformed_ops[op] = op_ |
| 472 | self.assign_collections_handler(info, op, op_) |
| 473 | |
| 474 | # Process output tensors. |
| 475 | for op_output, op_output_ in zip(op.outputs, op_outputs_): |
| 476 | info.transformed_ts[op_output] = op_output_ |
| 477 | self.assign_collections_handler(info, op_output, op_output_) |
| 478 | |
| 479 | def _finalize_cycles(self, info): |
| 480 | """Reconnects the cyclic tensors.""" |
no test coverage detected