aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Chris Leary <leary@google.com>2017-11-07 17:08:18 -0800
committerGravatar Andrew Selle <aselle@andyselle.com>2017-11-10 16:14:34 -0800
commitfe258b30534f9aa0525ce677d23d968456654a65 (patch)
tree5150bf9be1dfbace67914c12fc342915c9df1e0c
parent969eae0da7aed343b382d12d6e65dcf1d3bbcfad (diff)
[XLA] Add binary operation name to shape inference error message.
PiperOrigin-RevId: 174937290
-rw-r--r--tensorflow/compiler/xla/service/shape_inference.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/tensorflow/compiler/xla/service/shape_inference.cc b/tensorflow/compiler/xla/service/shape_inference.cc
index 791d17365b..9c7dc2185e 100644
--- a/tensorflow/compiler/xla/service/shape_inference.cc
+++ b/tensorflow/compiler/xla/service/shape_inference.cc
@@ -31,6 +31,7 @@ limitations under the License.
#include "tensorflow/core/lib/core/stringpiece.h"
#include "tensorflow/core/lib/math/math_util.h"
#include "tensorflow/core/lib/strings/str_util.h"
+#include "tensorflow/core/lib/strings/strcat.h"
#include "tensorflow/core/lib/strings/stringprintf.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/protobuf.h"
@@ -770,8 +771,12 @@ ShapeInference::InferDegenerateDimensionBroadcastShape(
TF_DCHECK_OK(ShapeUtil::ValidateShapeWithOptionalLayout(lhs));
TF_DCHECK_OK(ShapeUtil::ValidateShapeWithOptionalLayout(rhs));
- TF_RETURN_IF_ERROR(ExpectNotTupleOrOpaque(lhs, "lhs of binary operation"));
- TF_RETURN_IF_ERROR(ExpectNotTupleOrOpaque(rhs, "rhs of binary operation"));
+ TF_RETURN_IF_ERROR(ExpectNotTupleOrOpaque(
+ lhs, tensorflow::strings::StrCat("lhs of binary operation ",
+ BinaryOperation_Name(operation))));
+ TF_RETURN_IF_ERROR(ExpectNotTupleOrOpaque(
+ rhs, tensorflow::strings::StrCat("rhs of binary operation ",
+ BinaryOperation_Name(operation))));
switch (operation) {
case BINOP_DOT:
return InferDotOpShape(lhs, rhs);