未验证 提交 6f85e241 编写于 作者: K Kqnonrime 提交者: GitHub

fix one error massage (#31904)

* fix one error massage

* fix a error message

* new fix three error messages

* new fix three error messages

* new fix some error

* new fix one error message
上级 ea738dda
......@@ -108,7 +108,9 @@ class MeshgridGradOp : public framework::OperatorWithKernel {
void InferShape(framework::InferShapeContext* ctx) const override {
PADDLE_ENFORCE_GT(ctx->Inputs(framework::GradVarName("Out")).size(), 1,
platform::errors::InvalidArgument(
"Number of Inputs(Out@Grad) must be larger than 1"));
"Number of Inputs(Out@Grad) should be larger than 1."
"But received Inputs(Out@Grad)' size = %d .",
ctx->Inputs(framework::GradVarName("Out")).size()));
ctx->SetOutputsDim(framework::GradVarName("X"), ctx->GetInputsDim("X"));
}
......
......@@ -60,7 +60,8 @@ class MeshgridKernel : public framework::OpKernel<T> {
REP_MESHGRID_TEMPLATE(MAX_RANK_SUPPORTED)
default:
PADDLE_THROW(platform::errors::InvalidArgument(
"Only support tensor nums between 1 and 6."));
"Excepted Tensor numbers between 1 and 6, but only received d% .",
rank));
}
}
......@@ -71,7 +72,9 @@ class MeshgridKernel : public framework::OpKernel<T> {
auto outs = context.MultiOutput<framework::Tensor>("Out");
PADDLE_ENFORCE_EQ(
ins.size() > 1, true,
platform::errors::InvalidArgument("expect at least 2 input tensors"));
platform::errors::InvalidArgument(
"Expected at least 2 input tensors, but only received d%.",
ins.size()));
int64_t size = ins.size();
std::vector<int64_t> shape(size);
......@@ -131,7 +134,8 @@ class MeshgridGradKernel : public framework::OpKernel<T> {
REP_MESHGRID_GRAD_TEMPLATE(MAX_RANK_SUPPORTED)
default:
PADDLE_THROW(platform::errors::InvalidArgument(
"only support tensor nums being between 1 and 6."));
"Excepted Tensor numbers between 1 and 6, but only received d% .",
n));
}
}
......
......@@ -34,7 +34,7 @@ void GetSize(T start, T end, T step, int64_t* size) {
if (start > end) {
PADDLE_ENFORCE_LT(step, 0,
platform::errors::InvalidArgument(
"step should be less than 0 while start > end."));
"The step should be less than 0 while start > end."));
}
*size = std::is_integral<T>::value
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册