未验证 提交 3704471d 编写于 作者: J Jiabin Yang 提交者: GitHub

【Eager】Fix error raise (#51963)

* allow return none when stop_gradient=True

* remove useless code

* refine code

* refine code

* fix test cast

* change more test

* add more tests

* fix error msg in pylayer
上级 1f8e6ad6
...@@ -166,8 +166,8 @@ GradNodePyLayer::operator()( ...@@ -166,8 +166,8 @@ GradNodePyLayer::operator()(
grad_out.push_back({}); grad_out.push_back({});
} else { } else {
PADDLE_THROW(phi::errors::InvalidArgument( PADDLE_THROW(phi::errors::InvalidArgument(
"argument must be " "We can only support Tensor or None for backward output, "
"Tensor or None, but got %s", ", but got %s, please check your PyLayer code and make it fits",
reinterpret_cast<PyTypeObject*>(obj->ob_type)->tp_name)); reinterpret_cast<PyTypeObject*>(obj->ob_type)->tp_name));
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册