Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix handling of multiple QuantizeLinear nodes" #413

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -583,23 +583,22 @@ static void AddQDQNodeUnit(onnxruntime::Graph& dst_graph,

// Handle Qs in the NodeUnit
if (!node_unit.GetQNodes().empty()) {
for (auto i = 0 ; i < node_unit.GetQNodes().size() ; i++) {
const auto& q_node = node_unit.GetQNodes().at(0);

SkipReason reason;

bool keep_q = CheckQRuleSet(node_unit, q_node, src_graph, reason);

if (keep_q) {
AddNode(initializers_to_keep, src_graph, dst_graph, *q_node);
// if keep_q, then output defs of the target node doesn't change
output_args.push_back(&dst_graph.GetOrCreateNodeArg(target_node.OutputDefs().at(i)->Name(),
target_node.OutputDefs().at(i)->TypeAsProto()));
} else {
// convert this Q to float
output_args.push_back(&ProcessNodeUnitIO(dst_graph, src_graph, initializers_to_keep,
node_unit_outputs.at(i)));
}
ORT_ENFORCE(node_unit.GetQNodes().size() == 1);
const auto& q_node = node_unit.GetQNodes().at(0);

SkipReason reason;

bool keep_q = CheckQRuleSet(node_unit, q_node, src_graph, reason);

if (keep_q) {
AddNode(initializers_to_keep, src_graph, dst_graph, *q_node);
// if keep_q, then output defs of the target node doesn't change
output_args.push_back(&dst_graph.GetOrCreateNodeArg(target_node.OutputDefs().at(0)->Name(),
target_node.OutputDefs().at(0)->TypeAsProto()));
} else {
// convert this Q to float
output_args.push_back(&ProcessNodeUnitIO(dst_graph, src_graph, initializers_to_keep,
node_unit_outputs.at(0)));
}
} else {
for (const auto& node_unit_output : node_unit_outputs) {
Expand Down
Loading