aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/util/stat_summarizer.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-05-08 14:30:06 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-05-10 15:29:07 -0700
commitc7f79bb75b5b83c3011e164ccd617a6ada910ea4 (patch)
tree87890332de2fc0460c07448efd2fee4be7dc29dd /tensorflow/core/util/stat_summarizer.cc
parent09f3fb939c9b395a9bc747cf81d15b2dc2804c3e (diff)
Merged commit includes the following changes:
155427981 by andrewharp <andrewharp@google.com>: StatSummarizer: Put size check error message outside of if block where it belongs. -- 155427811 by A. Unique TensorFlower <gardener@tensorflow.org>: Internal change PiperOrigin-RevId: 155427981
Diffstat (limited to 'tensorflow/core/util/stat_summarizer.cc')
-rw-r--r--tensorflow/core/util/stat_summarizer.cc21
1 files changed, 12 insertions, 9 deletions
diff --git a/tensorflow/core/util/stat_summarizer.cc b/tensorflow/core/util/stat_summarizer.cc
index 8300ba370e..40ae85e44b 100644
--- a/tensorflow/core/util/stat_summarizer.cc
+++ b/tensorflow/core/util/stat_summarizer.cc
@@ -50,20 +50,23 @@ void StatSummarizer::Validate(const Detail* detail,
}
const auto& stored = detail->outputs[slot];
const auto& current = output.tensor_description();
- bool do_shapes_match = true;
- if (stored.shape().dim_size() != current.shape().dim_size()) {
- do_shapes_match = false;
- } else {
+
+ bool do_tensors_match =
+ (stored.dtype() == current.dtype()) &&
+ (stored.shape().dim_size() == current.shape().dim_size());
+
+ if (do_tensors_match) {
for (int i = 0; i < stored.shape().dim_size(); ++i) {
if (stored.shape().dim(i).size() != current.shape().dim(i).size()) {
- do_shapes_match = false;
+ do_tensors_match = false;
+ break;
}
}
+ }
- if ((stored.dtype() != current.dtype()) || !do_shapes_match) {
- LOG(WARNING) << "Output tensor changed between runs for '"
- << ns.node_name();
- }
+ if (!do_tensors_match) {
+ LOG(WARNING) << "Output tensor changed between runs for '"
+ << ns.node_name();
}
}
}