forked from mindspore-Ecosystem/mindspore
add_a_temp_solution_for_side_effect_grad_case_failed
This commit is contained in:
parent
a4eba53e55
commit
f1213ddb97
|
@ -504,6 +504,11 @@ PynativeAdjointPtr KPynativeCellImpl::ForgeMakeSequenceAdjoint(const CNodePtr &c
|
|||
} else if (inp->isa<ValueNode>()) {
|
||||
const auto &inp_value = GetValueNode(inp);
|
||||
op_args.push_back(inp_value);
|
||||
} else if (inp->isa<Parameter>()) {
|
||||
auto param = inp->cast<ParameterPtr>();
|
||||
const auto &abs = param->abstract();
|
||||
MS_EXCEPTION_IF_NULL(abs);
|
||||
op_args.push_back(abs->BuildValue());
|
||||
} else {
|
||||
MS_LOG(EXCEPTION) << "Input of MakeTuple/MakeLis is not a CNode or ValueNode, but: " << inp->DebugString();
|
||||
}
|
||||
|
|
|
@ -1789,7 +1789,7 @@ void GradExecutor::InitResourceAndDfBuilder(const std::string &cell_id, const py
|
|||
auto new_param = curr_g_->add_parameter();
|
||||
ValuePtr param_value = PyAttrValue(param);
|
||||
MS_EXCEPTION_IF_NULL(param_value);
|
||||
new_param->set_abstract(param_value->ToAbstract()->Broaden());
|
||||
new_param->set_abstract(param_value->ToAbstract());
|
||||
std::string param_id = GetId(param);
|
||||
SetTupleArgsToGraphInfoMap(curr_g_, param, new_param, true);
|
||||
SetNodeMapInGraphInfoMap(curr_g_, param_id, new_param);
|
||||
|
|
Loading…
Reference in New Issue