MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / WrapsSingleOp

Method WrapsSingleOp

tensorflow/compiler/mlir/tensorflow/ir/tf_executor.cc:319–328  ·  view source on GitHub ↗

Checks if a tf_executor.island wraps a single operation and the single operation results are perfectly forwarded to the islands yield.

Source from the content-addressed store, hash-verified

317// Checks if a tf_executor.island wraps a single operation and the single
318// operation results are perfectly forwarded to the islands yield.
319bool 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
330namespace {
331

Callers 1

PrintFunction · 0.45

Calls 3

equalFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected