Skip to content
Merged
Changes from 5 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 @@ -4,6 +4,7 @@
#include "core/optimizer/qdq_transformer/weight_bias_quantization.h"

#include "core/common/common.h"
#include "core/providers/common.h"
#include "core/util/qmath.h"
#include "core/graph/graph_utils.h"
#include "core/graph/graph_viewer.h"
Expand Down Expand Up @@ -128,6 +129,14 @@ Status WeightBiasQuantization::ApplyImpl(Graph& graph, bool& modified, int graph
int64_t axis = 1;
if (auto axis_iter = dq_attrs.find("axis"); axis_iter != dq_attrs.end()) {
axis = axis_iter->second.i();
const ONNX_NAMESPACE::TensorShapeProto* weight_shape = weight_arg->Shape();
if (!weight_shape && dq_1 && dq_1->InputDefs()[0]) {
Comment thread
edgchen1 marked this conversation as resolved.
Outdated
weight_shape = dq_1->InputDefs()[0]->Shape();
}
if (axis < 0 && !weight_shape) {
continue;
}
axis = HandleNegativeAxis(axis, weight_shape->dim_size());
Comment thread
qti-yuduo marked this conversation as resolved.
}

int64_t expected_axis = 0;
Expand Down