aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/framework/op_compatibility_test.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2018-01-11 12:35:25 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-11 12:39:29 -0800
commitec1ca2419ef33af62f5e7865d901981a96dbf6c9 (patch)
tree2682d36aba653748c138634805add141f2afbb40 /tensorflow/core/framework/op_compatibility_test.cc
parent86bbd32735250874919da6c35551a3801c9f51e9 (diff)
backward compat: Prevent changes to attr's default value only for last historical version.
PiperOrigin-RevId: 181646665
Diffstat (limited to 'tensorflow/core/framework/op_compatibility_test.cc')
-rw-r--r--tensorflow/core/framework/op_compatibility_test.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/tensorflow/core/framework/op_compatibility_test.cc b/tensorflow/core/framework/op_compatibility_test.cc
index 4f4813d9fa..b57bdcb841 100644
--- a/tensorflow/core/framework/op_compatibility_test.cc
+++ b/tensorflow/core/framework/op_compatibility_test.cc
@@ -173,7 +173,15 @@ class OpCompatibilityTest : public OpsTestBase {
// Validate that the NodeDef is valid.
TF_ASSERT_OK(ValidateNodeDef(*node_def(), *new_op_def));
- ExpectIncompatible(old_op_def, *new_op_def, compatibility_error);
+ Status status = OpDefAttrDefaultsUnchanged(old_op_def, *new_op_def);
+ if (status.ok()) {
+ ADD_FAILURE() << SummarizeOpDef(old_op_def) << " vs. "
+ << SummarizeOpDef(*new_op_def);
+ } else {
+ EXPECT_TRUE(
+ StringPiece(status.error_message()).contains(compatibility_error))
+ << status << " does not contain " << compatibility_error;
+ }
}
};