未验证 提交 cbbe1274 编写于 作者: H Huihuang Zheng 提交者: GitHub

Refine fake_interface Error Message (#30981)

Refine fake_interface Error Message
上级 c1375783
......@@ -248,8 +248,9 @@ def _fake_interface_only_(func):
raise AssertionError(
"'%s' should be called by imperative Varible in imperative mode, please run it in dygraph "
"mode. You can turn off paddle.enable_static() if you are in static mode, or turn off "
"ProgramTranslator if you are using @paddle.jit.to_static" %
func.__name__)
"ProgramTranslator if you are using @paddle.jit.to_static. If you have to run ProgramTranslator, "
"please use other API to replace '%s'" % (func.__name__,
func.__name__))
return __impl__
......
......@@ -162,7 +162,8 @@ class Test_Detach(unittest.TestCase):
"in imperative mode, please run it in dygraph mode. You can "
"turn off paddle.enable_static() if you are in static mode, "
"or turn off ProgramTranslator if you are using "
"@paddle.jit.to_static")
"@paddle.jit.to_static. If you have to run ProgramTranslator, "
"please use other API to replace 'detach'")
class TestInplace(unittest.TestCase):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册