Made sure to compare all the attributes when comparing nodes
authorBenoit Steiner <bsteiner@google.com>
Wed, 21 Mar 2018 19:14:30 +0000 (12:14 -0700)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 21 Mar 2018 19:17:35 +0000 (12:17 -0700)
PiperOrigin-RevId: 189946858

tensorflow/core/grappler/optimizers/arithmetic_optimizer.cc

index 942724a..bc004df 100644 (file)
@@ -1037,6 +1037,9 @@ bool UniqueNodes::SameNode(const NodeDef& node1, const NodeDef& node2) const {
   }
 
   // Compare attributes.
+  if (node1.attr().size() != node2.attr().size()) {
+    return false;
+  }
   for (const auto& attr1 : node1.attr()) {
     auto it = node2.attr().find(attr1.first);
     if (it == node2.attr().end()) {