aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/layout_util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/compiler/xla/layout_util.cc')
-rw-r--r--tensorflow/compiler/xla/layout_util.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/tensorflow/compiler/xla/layout_util.cc b/tensorflow/compiler/xla/layout_util.cc
index 3c8db9aa45..19667b7ed9 100644
--- a/tensorflow/compiler/xla/layout_util.cc
+++ b/tensorflow/compiler/xla/layout_util.cc
@@ -205,7 +205,7 @@ Layout CreateDefaultLayoutForRank(int64 rank) {
return Status::OK();
}
- if (layout.format() == INVALID_FORMAT) {
+ if (layout.format() == INVALID_FORMAT || !Format_IsValid(layout.format())) {
return InvalidArgument(
"Layout does not have a valid format: layout {%s}, shape {%s}",
layout.ShortDebugString(), shape.ShortDebugString());