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

Method WrapsSingleOp

tensorflow/compiler/mlir/tensorflow/ir/tf_device.cc:108–118  ·  view source on GitHub ↗

Checks if a tf_device.launch wraps a single operation and the single operation results are perfectly forwarded to the launch return.

Source from the content-addressed store, hash-verified

106// Checks if a tf_device.launch wraps a single operation and the single
107// operation results are perfectly forwarded to the launch return.
108bool LaunchOp::WrapsSingleOp() {
109 auto body = GetBody().without_terminator();
110 if (!has_single_element(body)) return false;
111
112 Operation& wrapped_op = *body.begin();
113 Operation* terminator = GetBody().getTerminator();
114 return wrapped_op.getNumResults() == terminator->getNumOperands() &&
115 std::equal(wrapped_op.getResults().begin(),
116 wrapped_op.getResults().end(),
117 terminator->getOperands().begin());
118}
119
120//===----------------------------------------------------------------------===//
121// tf_device.return

Callers 6

MergeIslandFunction · 0.45
runOnModuleMethod · 0.45
runOnFunctionMethod · 0.45
runOnFunctionMethod · 0.45
HandleReplicateOpFunction · 0.45

Calls 3

equalFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected