forked from mindspore-Ecosystem/mindspore
fix issue I3EAB6: exception while using unique ops
This commit is contained in:
parent
9263c4d63b
commit
b82529e26f
|
@ -94,13 +94,21 @@ void PrimBpropOptGraphLevel2Info::AnalysisNodeUsingInfo(
|
|||
arg_info.using_flg_ = true;
|
||||
MS_LOG(DEBUG) << "param:" << param->ToString() << " used by node:" << user_node->ToString();
|
||||
if (!IsPrimitiveCNode(user_node, prim::kPrimTupleGetItem)) {
|
||||
MS_LOG(EXCEPTION) << "tuple param:" << param->ToString() << " of bp_graph:" << opt_func_graph_->ToString()
|
||||
<< " unexpect used by node:" << user_node->ToString();
|
||||
for (auto &sub_info : arg_info.sub_using_info_) {
|
||||
sub_info.using_flg_ = true;
|
||||
}
|
||||
} else {
|
||||
AalysisForTupleGetItem(node_users, param, arg_info, user_node);
|
||||
}
|
||||
}
|
||||
}
|
||||
void PrimBpropOptGraphLevel2Info::AalysisForTupleGetItem(const NodeUsersMap &node_users,
|
||||
const std::shared_ptr<AnfNode> ¶m,
|
||||
ParamUsingInfo &arg_info,
|
||||
const AnfNodePtr &user_node) const {
|
||||
auto cnode = user_node->cast<CNodePtr>();
|
||||
if (cnode->size() != 3) {
|
||||
MS_LOG(EXCEPTION) << "TupleGetItem Node:" << user_node->ToString() << " of bp_graph:"
|
||||
<< opt_func_graph_->ToString()
|
||||
MS_LOG(EXCEPTION) << "TupleGetItem Node:" << user_node->ToString() << " of bp_graph:" << opt_func_graph_->ToString()
|
||||
<< "input size is:" << cnode->size();
|
||||
}
|
||||
auto idx_node = cnode->input(2);
|
||||
|
@ -126,7 +134,6 @@ void PrimBpropOptGraphLevel2Info::AnalysisNodeUsingInfo(
|
|||
AnalysisNodeUsingInfo(node_users, cnode, arg_info.sub_using_info_[idx]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PrimBpropOptGraphLevel2Info::ArgInfoRefresh(
|
||||
const std::shared_ptr<AnfNode> ¶m, ParamUsingInfo &arg_info) const {
|
||||
|
|
|
@ -119,6 +119,9 @@ private:
|
|||
|
||||
void TryFreeOneValue(const ValuePtrList &op_args, const std::vector<ParamUsingInfo> ¶m_info_vec);
|
||||
|
||||
void AalysisForTupleGetItem(const NodeUsersMap &node_users, const std::shared_ptr<AnfNode> ¶m,
|
||||
ParamUsingInfo &arg_info, const AnfNodePtr &user_node) const;
|
||||
|
||||
private:
|
||||
// the level2 opt func_graph
|
||||
FuncGraphPtr opt_func_graph_;
|
||||
|
|
Loading…
Reference in New Issue