aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Josh Levenberg <josh11b@tensorflow.org>2016-05-02 13:13:02 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-05-02 14:21:42 -0700
commite5249d6dddc469e68c09b3af32a9adfdffdb5ef1 (patch)
tree486856776b31a956fd5f611fec37c4179b70578e
parent3ec413ac5aae8e91870b18bdf15edf27cab77a00 (diff)
List all removed stable ops in the error message, not just the first.
Change: 121309048
-rw-r--r--tensorflow/core/ops/compat/op_compatibility_lib.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/tensorflow/core/ops/compat/op_compatibility_lib.cc b/tensorflow/core/ops/compat/op_compatibility_lib.cc
index 81a65b2e52..b8df96d5e8 100644
--- a/tensorflow/core/ops/compat/op_compatibility_lib.cc
+++ b/tensorflow/core/ops/compat/op_compatibility_lib.cc
@@ -21,6 +21,7 @@ limitations under the License.
#include "tensorflow/core/lib/core/errors.h"
#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/lib/io/path.h"
+#include "tensorflow/core/lib/strings/str_util.h"
#include "tensorflow/core/lib/strings/strcat.h"
#include "tensorflow/core/platform/protobuf.h"
@@ -54,19 +55,26 @@ Status OpCompatibilityLib::ValidateCompatible(Env* env, int* changed_ops,
if (stable_ops_ != nullptr) {
printf("Verifying no stable ops have been removed...\n");
+ std::vector<string> removed;
// We rely on stable_ops_ and op_list_ being in sorted order.
auto iter = stable_ops_->begin();
for (int cur = 0; iter != stable_ops_->end() && cur < op_list_.op_size();
++cur) {
const string& op_name = op_list_.op(cur).name();
- if (op_name > *iter) {
- return errors::InvalidArgument("Error, stable op removed: ", *iter);
- } else if (op_name == *iter) {
+ while (op_name > *iter) {
+ removed.push_back(*iter);
++iter;
}
+ if (op_name == *iter) {
+ ++iter;
+ }
+ }
+ for (; iter != stable_ops_->end(); ++iter) {
+ removed.push_back(*iter);
}
- if (iter != stable_ops_->end()) {
- return errors::InvalidArgument("Error, stable op removed: ", *iter);
+ if (!removed.empty()) {
+ return errors::InvalidArgument("Error, stable op(s) removed: ",
+ str_util::Join(removed, ", "));
}
}