diff --git a/mindspore/lite/tools/converter/quantizer/aware_quantizer.cc b/mindspore/lite/tools/converter/quantizer/aware_quantizer.cc index 4dead32be9b1fe15577758c4d75b47e4348fa2b8..a899ad17e19171707687c90c0a0b225218d0bcd6 100644 --- a/mindspore/lite/tools/converter/quantizer/aware_quantizer.cc +++ b/mindspore/lite/tools/converter/quantizer/aware_quantizer.cc @@ -293,13 +293,13 @@ STATUS AwareQuantizer::GenerateQuantParam() { MS_ASSERT(graph->inputIndex.size() == 1); // set graphInputNode input for (auto graphInputIndex : graph->inputIndex) { - auto status = mInputArray->SetInputArrayQP(graph.get(), graphInputIndex); + auto status = mInputArray->SetInputArrayQP(graph, graphInputIndex); if (status != RET_OK) { MS_LOG(ERROR) << "SetInputArrayQP failed"; return status; } } - auto status = GenerateDefaultQuantParam(graph.get()); + auto status = GenerateDefaultQuantParam(graph); if (status != RET_OK) { MS_LOG(ERROR) << "GenerateDefaultQuantParam failed"; return status; @@ -319,7 +319,7 @@ STATUS AwareQuantizer::GenerateQuantParam() { << ", type: " << GetCNodeTTypeName(*node).c_str() << " set node to QuantNone and skip"; node->quantType = static_cast(QuantType_QUANT_NONE); } else { - status = quantParamCalcer->Calc(graph.get(), *node); + status = quantParamCalcer->Calc(graph, *node); if (status != RET_OK) { MS_LOG(ERROR) << "quantParamCalcer failed: " << status << " node: " << node->name.c_str(); node->quantType = schema::QuantType_QUANT_NONE; @@ -349,27 +349,27 @@ STATUS AwareQuantizer::DoQuantize() { return RET_ERROR; } // quant weight - status = QuantConvWeight(graph.get(), node.get()); + status = QuantConvWeight(graph, node.get()); if (status != RET_OK) { MS_LOG(ERROR) << "QuantConvWeight failed!"; return RET_ERROR; } // quant bias if (inputIndexes.size() == 3) { - status = QuantConvBias(graph.get(), node.get()); + status = QuantConvBias(graph, node.get()); if (status != RET_OK) { MS_LOG(ERROR) << "QuantConvBias failed!"; return RET_ERROR; } } } else if (GetCNodeTType(*node) == schema::PrimitiveType_DetectionPostProcess) { - status = QuantDetectionPostProcessConstTensor(graph.get(), node.get()); + status = QuantDetectionPostProcessConstTensor(graph, node.get()); if (status != RET_OK) { MS_LOG(ERROR) << "QuantDetectionPostProcessConstTensor failed!"; return RET_ERROR; } } else if (GetCNodeTType(*node) == schema::PrimitiveType_Add) { - status = QuantAddConstTensor(graph.get(), node.get()); + status = QuantAddConstTensor(graph, node.get()); if (status != RET_OK) { MS_LOG(ERROR) << "QuantAddConstTensor failed!"; return RET_ERROR; diff --git a/mindspore/lite/tools/converter/quantizer/quantizer.h b/mindspore/lite/tools/converter/quantizer/quantizer.h index 741c8f95cb1e26540ea5987ce2be5a0670f9f4da..dbf93af6fab39de16d259b82517c85ffa6591909 100644 --- a/mindspore/lite/tools/converter/quantizer/quantizer.h +++ b/mindspore/lite/tools/converter/quantizer/quantizer.h @@ -73,7 +73,7 @@ class FbQuantizer { virtual STATUS DoQuantize() = 0; protected: - std::shared_ptr graph = nullptr; + schema::MetaGraphT *graph = nullptr; }; } // namespace mindspore::lite::quant