未验证 提交 2f9cdd90 编写于 作者: Y ysh329 提交者: GitHub

API/OP clip_by_norm_op error message enhancement. test=develop (#27614)

* Fix clip_by_norm_op error message. test=develop

* test=develop

* test=develop
上级 78014059
...@@ -63,8 +63,10 @@ class ClipByNormKernel : public framework::OpKernel<T> { ...@@ -63,8 +63,10 @@ class ClipByNormKernel : public framework::OpKernel<T> {
output->Resize(merged_input->value().dims()); output->Resize(merged_input->value().dims());
output->mutable_data<T>(context.GetPlace()); output->mutable_data<T>(context.GetPlace());
} else { } else {
PADDLE_THROW("Unexpected branch, input variable type is %s", PADDLE_THROW(platform::errors::InvalidArgument(
framework::ToTypeName(in_var->Type())); "Invalid input variable type, only support LodTensor and "
"SelectedRows types, but got type is %s.",
framework::ToTypeName(in_var->Type())));
} }
PADDLE_ENFORCE_NOT_NULL(input, PADDLE_ENFORCE_NOT_NULL(input,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册