提交 c812998f 编写于 作者: K kpy

fix cast and mix_cast bug

上级 0d8a3821
......@@ -323,12 +323,6 @@ OpExecInfoPtr GenerateOpExecInfo(const py::args &args) {
}
op_exec_info->py_primitive = prim;
op_exec_info->op_attrs = py::getattr(args[PY_PRIM], "attrs");
auto inst = PynativeExecutor::GetInstance();
if (inst->grad_flag()) {
op_exec_info->value = inst->GetForwardValue(op_exec_info);
} else {
(void)GetOpId(op_exec_info);
}
op_exec_info->op_inputs = args[PY_INPUTS];
ConvertInputs(prim, args[PY_INPUTS], op_exec_info);
return op_exec_info;
......@@ -903,6 +897,12 @@ py::tuple PynativeExecutor::RunOpInner(const py::args &args) {
MS_LOG(DEBUG) << "set prim " << op_exec_info->op_name << mindspore::ToString(args_spec_list);
}
if (PynativeExecutor::GetInstance()->grad_flag()) {
op_exec_info->value = PynativeExecutor::GetInstance()->GetForwardValue(op_exec_info);
} else {
(void)GetOpId(op_exec_info);
}
auto result = RunOpInner(op_exec_info);
py::object out_real = result;
if (result.size() == 1) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部