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

Function IsControlFlowOp

tensorflow/lite/toco/tflite/export.cc:55–68  ·  view source on GitHub ↗

Check if a TensorFlow Op is a control flow op by its name.

Source from the content-addressed store, hash-verified

53
54// Check if a TensorFlow Op is a control flow op by its name.
55bool IsControlFlowOp(const string& tensorflow_op) {
56 // Technically this is equalivent to `::tensorflow::Node::IsControlFlow()`.
57 // It requires to construct a `::tensorflow::Graph` to use that helper
58 // function, so we simply hardcode the list of control flow ops here.
59 if (tensorflow_op == "Switch" || tensorflow_op == "RefSwitch" ||
60 tensorflow_op == "Merge" || tensorflow_op == "RefMerge" ||
61 tensorflow_op == "Enter" || tensorflow_op == "RefEnter" ||
62 tensorflow_op == "Exit" || tensorflow_op == "RefExit" ||
63 tensorflow_op == "NextIteration" || tensorflow_op == "RefNextIteration") {
64 return true;
65 }
66 // TODO(ycling): Also check how to handle Variable ops and Assign ops.
67 return false;
68}
69
70// Check if a TensorFlow Op is unsupported by the Flex runtime.
71bool IsUnsupportedFlexOp(const string& tensorflow_op) {

Callers 2

IsUnsupportedFlexOpFunction · 0.85
ParseControlFlowErrorsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected