Check for the value of the _XlaCompile boolean since xla often creates it with
authorBenoit Steiner <bsteiner@google.com>
Wed, 14 Mar 2018 16:47:47 +0000 (09:47 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 14 Mar 2018 16:51:11 +0000 (09:51 -0700)
the default value of false.

PiperOrigin-RevId: 189041421

tensorflow/core/grappler/optimizers/constant_folding.cc

index 21037ff..821b22a 100644 (file)
@@ -752,7 +752,8 @@ bool ConstantFolding::IsFoldable(const NodeDef& node) const {
   if (op.find("Quantized") != string::npos || op.find("Sparse") == 0) {
     return false;
   }
-  if (node.attr().count("_XlaCompile") > 0) {
+  if (node.attr().count("_XlaCompile") > 0 &&
+      node.attr().at("_XlaCompile").b()) {
     return false;
   }