未验证 提交 3e0c4929 编写于 作者: X xiemoyuan 提交者: GitHub

Optimize the error message of framework. (#30134)

上级 9922bd41
...@@ -42,7 +42,8 @@ class TraceOp : public framework::OperatorWithKernel { ...@@ -42,7 +42,8 @@ class TraceOp : public framework::OperatorWithKernel {
PADDLE_ENFORCE_GE( PADDLE_ENFORCE_GE(
x_dims.size(), 2, x_dims.size(), 2,
platform::errors::OutOfRange( platform::errors::OutOfRange(
"trace requires an tensor of at least two dimensions")); "Input's dim is out of range (expected at least 2, but got %ld).",
x_dims.size()));
PADDLE_ENFORCE_LT( PADDLE_ENFORCE_LT(
dim1_, x_dims.size(), dim1_, x_dims.size(),
platform::errors::OutOfRange( platform::errors::OutOfRange(
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册