未验证 提交 9f02c284 编写于 作者: S ShenLiang 提交者: GitHub

fix error message (#30135) (#30182)

上级 07f68fad
......@@ -106,8 +106,10 @@ class MatrixInverseFunctor<platform::CUDADeviceContext, T> {
for (int i = 0; i < batch_size; ++i) {
PADDLE_ENFORCE_EQ(info[i], 0,
platform::errors::PreconditionNotMet(
"For batch [%d]: U(%d, %d) is zero, singular U.", i,
info[i], info[i]));
"For batch [%d]: U(%d, %d) is zero, singular U. "
"Please check the matrix value and change it to a "
"non-singular matrix",
i, info[i], info[i]));
}
}
};
......
......@@ -58,7 +58,9 @@ class RankAttentionOp : public framework::OperatorWithKernel {
PADDLE_ENFORCE_EQ((rank_offset_dims[1] - 1) / 2, max_rank,
platform::errors::InvalidArgument(
"Input(RankOffset) has wrong columns."));
"Input(RankOffset) has wrong columns, "
"except columns to be %d, but got %d",
max_rank, (rank_offset_dims[1] - 1) / 2));
ctx->SetOutputDim("Out", {ins_num, para_col});
ctx->SetOutputDim("InputHelp", {ins_num, block_matrix_row});
......
......@@ -128,7 +128,11 @@ void ScatterAssignAdd(const framework::ExecutionContext& ctx, const Tensor& src,
PADDLE_ENFORCE_EQ(
index.dims().size() == 1 ||
(index.dims().size() == 2 && index.dims()[1] == 1),
true, platform::errors::InvalidArgument("index's shape is error."));
true, platform::errors::InvalidArgument(
"index's shape is error, "
"expect index'dims shape is 1 or 2 and index.dims[1] is 1"
"but got index'dims shape is %d",
index.dims().size()));
int index_size = index.dims()[0];
auto src_dims = src.dims();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册