Checks if a tf_executor.island wraps a single operation and the single operation results are perfectly forwarded to the islands yield.
| 317 | // Checks if a tf_executor.island wraps a single operation and the single |
| 318 | // operation results are perfectly forwarded to the islands yield. |
| 319 | bool IslandOp::WrapsSingleOp() { |
| 320 | auto body = GetBody().without_terminator(); |
| 321 | if (!has_single_element(body)) return false; |
| 322 | |
| 323 | Operation &wrapped_op = *body.begin(); |
| 324 | YieldOp yield = GetYield(); |
| 325 | return wrapped_op.getNumResults() == yield.getNumOperands() && |
| 326 | std::equal(wrapped_op.getResults().begin(), |
| 327 | wrapped_op.getResults().end(), yield.getOperands().begin()); |
| 328 | } |
| 329 | |
| 330 | namespace { |
| 331 |