Skip to content

Commit

Permalink
Address reviewer comment: fix get network precision logic
Browse files Browse the repository at this point in the history
Signed-off-by: Shoujiang Ma <[email protected]>
  • Loading branch information
mashoujiang committed May 19, 2021
1 parent 485e217 commit e1d9cdc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions inference-engine/src/auto_plugin/auto_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <threading/ie_executor_manager.hpp>
#include <ie_algorithm.hpp>
#include <ngraph/opsets/opset1.hpp>
#include <transformations/utils/utils.hpp>

#include <auto_plugin/auto_config.hpp>
#include "auto_plugin.hpp"
Expand All @@ -22,10 +23,11 @@ namespace AutoPlugin {
namespace {
std::string GetNetworkPrecision(const InferenceEngine::CNNNetwork &network) {
auto nGraphFunc = network.getFunction();
bool isINTModel = ngraph::op::util::has_op_with_type<ngraph::op::FakeQuantize>(nGraphFunc);
if (isINTModel) {
return METRIC_VALUE(INT8);
}
for (auto & node : nGraphFunc->get_ordered_ops()) {
if (std::dynamic_pointer_cast<ngraph::op::FakeQuantize>(node)) {
return METRIC_VALUE(INT8);
}
if (std::dynamic_pointer_cast<ngraph::opset1::Convolution>(node) ||
std::dynamic_pointer_cast<ngraph::opset1::GroupConvolution>(node) ||
std::dynamic_pointer_cast<ngraph::opset1::GroupConvolutionBackpropData>(node) ||
Expand Down

0 comments on commit e1d9cdc

Please sign in to comment.