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

Fix four error messages (#32899)

* fix two error message

* fix two error message

* fix error

* fix error

* fix error

* fix error

* fix some error message

* fix some error

* fix error

* fix some error

* fix some error

* fix some error

* fix one error

* fix some error

* fix seven error message

* fix error

* fix error

* fix error

* fix error

* fix some error message

* fix error

* fix some error

* fix some error

* fix four error message

* fix error

* fix error
上级 479689f6
......@@ -173,7 +173,9 @@ void FusedBatchNormActOpMaker::Make() {
.AddCustomChecker([](const float &epsilon) {
PADDLE_ENFORCE_EQ(epsilon >= 0.0f && epsilon <= 0.001f, true,
platform::errors::InvalidArgument(
"'epsilon' should be between 0.0 and 0.001."));
"Attr(epsilon) should be between 0.0 and 0.001, "
"but received value is %f.",
epsilon));
});
AddAttr<std::string>("act_type", "The activation type to be fused.")
.SetDefault("relu");
......
......@@ -25,11 +25,13 @@ class EmbeddingEltWiseLayerNormOp : public framework::OperatorWithKernel {
protected:
void InferShape(framework::InferShapeContext* context) const override {
PADDLE_ENFORCE_EQ(context->Inputs("Ids").size(),
context->Inputs("Embs").size(),
PADDLE_ENFORCE_EQ(
context->Inputs("Ids").size(), context->Inputs("Embs").size(),
platform::errors::InvalidArgument(
"Two inputs of EmbeddingEltWiseLayerNormOp shoube be "
"the same size"));
"the same size, but received the size of input Ids = %d,"
" the size of input Embs = %d",
context->Inputs("Ids").size(), context->Inputs("Embs").size()));
PADDLE_ENFORCE_GE(context->Inputs("Embs").size(), 2UL,
platform::errors::InvalidArgument(
"Input Embs of EmbeddingEltWiseLayerNormOp should "
......@@ -77,7 +79,8 @@ class EmbeddingEltWiseLayerNormOp : public framework::OperatorWithKernel {
PADDLE_ENFORCE_EQ(
embs_dims[i][1], hidden,
platform::errors::InvalidArgument(
"The Emb first dim size(%d) shoule equal to hidden (%d).",
"The second dimension size(%d) of the Embedding should be "
"equal to the hidden's size(%d)",
embs_dims[i][1], hidden));
}
......
......@@ -40,7 +40,9 @@ class TransposeFlattenConcatFusionOp : public framework::OperatorWithKernel {
const size_t n = ins.size();
PADDLE_ENFORCE_GT(n, 0,
platform::errors::InvalidArgument(
"Input tensors dim size should greater than 0."));
"The size of Inputs(X)'s dimension should be greater "
" than 0, but received %d.",
n));
std::vector<int> trans_axis =
ctx->Attrs().Get<std::vector<int>>("trans_axis");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册