提交 3bf1bb63 编写于 作者: F fary86

Fix codex

上级 05c1b36c
......@@ -274,14 +274,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.
先完成此消息的编辑!
想要评论请 注册