diff options
Diffstat (limited to 'tensorflow/core/grappler/op_types.cc')
-rw-r--r-- | tensorflow/core/grappler/op_types.cc | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/tensorflow/core/grappler/op_types.cc b/tensorflow/core/grappler/op_types.cc index cbf5c8e038..1b5a215987 100644 --- a/tensorflow/core/grappler/op_types.cc +++ b/tensorflow/core/grappler/op_types.cc @@ -102,19 +102,15 @@ bool IsConjugateTranspose(const NodeDef& node) { } bool IsControlFlow(const NodeDef& node) { - // TODO(williamchan): Add a microbenchmark to compare FlatSet vs. iterative - // string comparison. - static const gtl::FlatSet<string>* const kControFlowOps = - CHECK_NOTNULL((new gtl::FlatSet<string>{ - "ControlTrigger", - "Enter", - "Exit", - "LoopCond", - "Merge", - "NextIteration", - "Switch", - })); - return kControFlowOps->count(node.op()) > 0; + // clang-format off + return node.op() == "ControlTrigger" || + node.op() == "Enter" || + node.op() == "Exit" || + node.op() == "LoopCond" || + node.op() == "Merge" || + node.op() == "NextIteration" || + node.op() == "Switch"; + // clang-format on } bool IsConv2D(const NodeDef& node) { return node.op() == "Conv2D"; } |