Skip to content

Commit

Permalink
[CPU] zero-point fix
Browse files Browse the repository at this point in the history
  • Loading branch information
eshoguli committed Jul 7, 2023
1 parent 14292b8 commit 90fd678
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/plugins/intel_cpu/src/graph_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,19 @@ void GraphOptimizer::FuseConvolutionAndZeroPoints(Graph &graph) {
}

auto subtractArg0 = parent0->getParentEdgesAtPort(0)[0]->getParent();
if (subtractArg0->getOriginalOutputPrecisionAtPort(0) != Precision::U8)
const auto getOutputEdgeNum = [](const NodePtr& parent, const NodePtr& child) {
for (const auto& childEdge : parent->getChildEdges()) {
const auto& edge = childEdge.lock();
const auto& edgeChild = edge->getChild();
if (edgeChild == child) {
return edge->getInputNum();
}
}
IE_THROW() << "Child '" << child->getName() << "' was not found for node '" << parent->getName() << "'";
};

const size_t portNum = getOutputEdgeNum(subtractArg0, parent0);
if (subtractArg0->getOriginalOutputPrecisionAtPort(portNum) != Precision::U8)
return false;

auto zeroPointsConstant = dynamic_cast<node::Input*>(subtractArg1.get());
Expand Down

0 comments on commit 90fd678

Please sign in to comment.