From 59ca96c1f28030d2763a16af60521142c87b4dfd Mon Sep 17 00:00:00 2001 From: hangangqiang Date: Tue, 15 Dec 2020 10:20:21 +0800 Subject: [PATCH] fix bug in insert format transform node pass --- mindspore/lite/tools/common/graph_util.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mindspore/lite/tools/common/graph_util.cc b/mindspore/lite/tools/common/graph_util.cc index 30632ee916e..1333e8da3f7 100644 --- a/mindspore/lite/tools/common/graph_util.cc +++ b/mindspore/lite/tools/common/graph_util.cc @@ -415,6 +415,7 @@ NodeIter InsertNodeBefore(schema::MetaGraphT *graphT, NodeIter existNodeIter, si *errorCode = RET_NULL_PTR; return graphT->nodes.end(); } + toAddTensor->nodeType = schema::NodeType_CNode; preTensor->refCount = 0; preTensor->data.clear(); MS_ASSERT(toAddNodeIn->primitive != nullptr); @@ -456,6 +457,7 @@ NodeIter InsertNodeBefore(schema::MetaGraphT *graphT, NodeIter existNodeIter, si MS_LOG(ERROR) << "Copy TensorT failed"; return graphT->nodes.end(); } + toAddTensor->nodeType = schema::NodeType_CNode; MS_ASSERT(toAddNodeIn->primitive != nullptr); if (toAddNodeIn->primitive->value.type == schema::PrimitiveType_QuantDTypeCast) { auto prim = toAddNodeIn->primitive->value.AsQuantDTypeCast(); @@ -515,6 +517,7 @@ NodeIter InsertNodeAfter(schema::MetaGraphT *graphT, NodeIter existNodeIter, siz *errorCode = RET_NULL_PTR; return graphT->nodes.end(); } + toAddTensor->nodeType = schema::NodeType_CNode; MS_ASSERT(toAddNodeIn->primitive != nullptr); if (toAddNodeIn->primitive->value.type == schema::PrimitiveType_QuantDTypeCast) { auto prim = toAddNodeIn->primitive->value.AsQuantDTypeCast(); @@ -559,6 +562,7 @@ NodeIter InsertNodeAfter(schema::MetaGraphT *graphT, NodeIter existNodeIter, siz *errorCode = RET_NULL_PTR; return graphT->nodes.end(); } + toAddTensor->nodeType = schema::NodeType_CNode; graphT->allTensors.emplace_back(std::move(toAddTensor)); size_t toAddTensorIdx = graphT->allTensors.size() - 1; auto toAddNode = opDefCopyer(toAddNodeIn.get());