fix the error message that profiler does not support pynative mode.

This commit is contained in:
casgj 2021-09-29 01:43:28 +00:00 committed by Gitee
parent 2dcdadc29b
commit 92052be1b6
1 changed files with 3 additions and 3 deletions

View File

@ -49,10 +49,10 @@ INIT_OP_NAME = 'Default/InitDataSetQueue'
def _environment_check():
if c_expression.security.enable_security():
raise Runtime("Profiler is not supported if compiled with \'-s on\'")
raise RuntimeError("Profiler is not supported if compiled with \'-s on\'")
if context.get_context("mode") == context.PYNATIVE_MODE:
raise Runtime("Profiler is not supported in pynative mode currently, "
"and it is only supported in graph mode.")
raise RuntimeError("Profiler is not supported in pynative mode currently, "
"and it is only supported in graph mode.")
class ProfileOption(Enum):