提交 5812c46e 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!1860 fix codex

Merge pull request !1860 from fary86/fix_codex_06.05
......@@ -275,14 +275,15 @@ AnfNodePtr MixedPrecisionCastHelper(AnfNodePtr source_node, AbstractBasePtr node
} else if (node_type->isa<AbstractTuple>()) {
auto x = node_type->cast<AbstractTuplePtr>();
auto &items = x->elements();
std::size_t size = items.size();
std::vector<AnfNodePtr> nodes;
nodes.emplace_back(NewValueNode(prim::kPrimMakeTuple));
for (int i = 0; i < SizeToInt(size); i++) {
int idx = 0;
for (const auto &item : items) {
AnfNodePtr tuple_node =
func_graph->NewCNode({NewValueNode(prim::kPrimTupleGetItem), source_node, NewValueNode(i)});
AnfNodePtr node = MixedPrecisionCastHelper(tuple_node, items[i], target_type, func_graph);
func_graph->NewCNode({NewValueNode(prim::kPrimTupleGetItem), source_node, NewValueNode(idx)});
AnfNodePtr node = MixedPrecisionCastHelper(tuple_node, item, target_type, func_graph);
nodes.emplace_back(node);
++idx;
}
target_node = func_graph->NewCNode(nodes);
}
......
......@@ -27,6 +27,7 @@ template <class T>
class UnionFindSet {
public:
UnionFindSet() : union_find_set_() {}
~UnionFindSet() = default;
void Add(const T &elem) {
if (union_find_set_.find(elem) != union_find_set_.end()) {
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册