forked from mindspore-Ecosystem/mindspore
Graph kernel use control sink
Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
This commit is contained in:
parent
166d886501
commit
dd22792344
|
@ -429,7 +429,12 @@ CNodePtr SessionBasic::CreateNewCNode(const CNodePtr &cnode, KernelGraph *graph)
|
||||||
std::vector<AnfNodePtr> cnode_inputs;
|
std::vector<AnfNodePtr> cnode_inputs;
|
||||||
auto attr_input = cnode->input(kAnfPrimitiveIndex);
|
auto attr_input = cnode->input(kAnfPrimitiveIndex);
|
||||||
MS_EXCEPTION_IF_NULL(attr_input);
|
MS_EXCEPTION_IF_NULL(attr_input);
|
||||||
if (IsValueNode<FuncGraph>(attr_input)) {
|
if (AnfAlgo::IsGraphKernel(cnode)) {
|
||||||
|
auto fg = AnfAlgo::GetCNodeFuncGraphPtr(cnode);
|
||||||
|
MS_EXCEPTION_IF_NULL(fg);
|
||||||
|
auto new_fg = BasicClone(fg);
|
||||||
|
cnode_inputs.push_back(std::make_shared<ValueNode>(new_fg));
|
||||||
|
} else if (IsValueNode<FuncGraph>(attr_input)) {
|
||||||
// create primitive of cnode:call
|
// create primitive of cnode:call
|
||||||
cnode_inputs = {graph->NewValueNode(NewValueNode(std::make_shared<Primitive>(prim::kPrimCall->name())))};
|
cnode_inputs = {graph->NewValueNode(NewValueNode(std::make_shared<Primitive>(prim::kPrimCall->name())))};
|
||||||
// create a ValueNode<KernelGraph> as input of cnode:call
|
// create a ValueNode<KernelGraph> as input of cnode:call
|
||||||
|
|
Loading…
Reference in New Issue