From 30d000f8c230e012e048f1ab9a27beaf1a75dfdf Mon Sep 17 00:00:00 2001 From: hong <43953930+phlrain@users.noreply.github.com> Date: Wed, 25 Dec 2019 10:18:40 +0800 Subject: [PATCH] fix matmul error message; test=develop (#21885) --- paddle/fluid/operators/matmul_op.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/operators/matmul_op.cc b/paddle/fluid/operators/matmul_op.cc index 587d6bdc0d8..f9799cba346 100644 --- a/paddle/fluid/operators/matmul_op.cc +++ b/paddle/fluid/operators/matmul_op.cc @@ -349,10 +349,11 @@ class MatMulOp : public framework::OperatorWithKernel { #else PADDLE_ENFORCE_EQ( mat_dim_x.width_, mat_dim_y.height_, - "ShapeError: Input X's width should be equal to the Y's height, " - "but received X's shape: %s," - "Y's shape: %s.", - DumpMatrixShape(mat_dim_x).c_str(), DumpMatrixShape(mat_dim_y).c_str()); + platform::errors::InvalidArgument( + "ShapeError: Input X's width should be equal to the Y's height, " + "but received X's shape: [%s]," + "Y's shape: [%s].", + dim_x, dim_y)); #endif std::vector dim_out; -- GitLab