!47553 Fix cast bug in GE

Merge pull request !47553 from liangzelang/master
This commit is contained in:
i-robot 2023-01-10 04:02:50 +00:00 committed by Gitee
commit 67123d32ed
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ AnfNodePtr CreateCastNode(const FuncGraphPtr &graph, const AnfNodePtr &input, co
AnfNodePtr cast = graph->NewCNode({NewValueNode(std::make_shared<Primitive>(kCastOpName)), input});
common::AnfAlgo::SetOutputTypeAndDetailShape({dst_type}, {common::AnfAlgo::GetOutputDetailShape(input, 0)},
cast.get());
common::AnfAlgo::SetNodeAttr(kAttrDstType, MakeValue(static_cast<size_t>(dst_type)), cast);
common::AnfAlgo::SetNodeAttr(kAttrDstType, TypeIdToType(dst_type), cast);
cast->set_scope(input->scope());
return cast;
}