!22766 Fix bug of mindir run failed

Merge pull request !22766 from JoyLvliang/fix_bug_of_mindir_run_failed
This commit is contained in:
i-robot 2021-09-02 11:42:02 +00:00 committed by Gitee
commit f1aeb0db7f
1 changed files with 2 additions and 1 deletions

View File

@ -211,6 +211,7 @@ class _MindsporeFunctionExecutor:
if context.get_context("mode") == context.PYNATIVE_MODE:
_pynative_executor.set_graph_phase(phase)
_pynative_executor.grad_ms_function(output, *new_inputs)
if phase.find("export") == -1:
output = output[0]
return output