未验证 提交 37f2151f 编写于 作者: A Aganlengzi 提交者: GitHub

[Err msg] optimize kernel call error message (#44001)

上级 692466b4
...@@ -257,29 +257,35 @@ void BuildDygraphPhiKernelContext(const phi::KernelSignature& kernel_signature, ...@@ -257,29 +257,35 @@ void BuildDygraphPhiKernelContext(const phi::KernelSignature& kernel_signature,
auto& output_defs = phi_kernel.args_def().output_defs(); auto& output_defs = phi_kernel.args_def().output_defs();
auto& attr_defs = phi_kernel.args_def().attribute_defs(); auto& attr_defs = phi_kernel.args_def().attribute_defs();
PADDLE_ENFORCE_EQ(input_names.size(), PADDLE_ENFORCE_EQ(
input_defs.size(), input_names.size(),
platform::errors::InvalidArgument( input_defs.size(),
"the size of inputs_args names (%d) must be equal to " platform::errors::InvalidArgument(
"the size of kernel input_defs (%d).", "Op %s: the size of inputs_args names (%d) must be equal to "
input_names.size(), "the size of kernel input_defs (%d).",
input_defs.size())); kernel_signature.name,
input_names.size(),
PADDLE_ENFORCE_EQ(output_names.size(), input_defs.size()));
output_defs.size(),
platform::errors::InvalidArgument( PADDLE_ENFORCE_EQ(
"the size of outputs_args names (%d) must be equal to " output_names.size(),
"the size of kernel output_defs (%d).", output_defs.size(),
output_names.size(), platform::errors::InvalidArgument(
output_defs.size())); "Op %s: the size of outputs_args names (%d) must be equal to "
"the size of kernel output_defs (%d).",
PADDLE_ENFORCE_EQ(attr_names.size(), kernel_signature.name,
attr_defs.size(), output_names.size(),
platform::errors::InvalidArgument( output_defs.size()));
"the size of attribute_args names (%d) must be equal "
"to the size of kernel attribute_defs (%d).", PADDLE_ENFORCE_EQ(
attr_names.size(), attr_names.size(),
attr_defs.size())); attr_defs.size(),
platform::errors::InvalidArgument(
"Op %s: the size of attribute_args names (%d) must be equal "
"to the size of kernel attribute_defs (%d).",
kernel_signature.name,
attr_names.size(),
attr_defs.size()));
for (size_t i = 0; i < input_names.size(); ++i) { for (size_t i = 0; i < input_names.size(); ++i) {
auto it = ins.find(input_names[i]); auto it = ins.find(input_names[i]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册