diff --git a/onnxruntime/core/optimizer/transpose_optimization/onnx_transpose_optimization.cc b/onnxruntime/core/optimizer/transpose_optimization/onnx_transpose_optimization.cc index 96e263dc54043..580bd0bded4bc 100644 --- a/onnxruntime/core/optimizer/transpose_optimization/onnx_transpose_optimization.cc +++ b/onnxruntime/core/optimizer/transpose_optimization/onnx_transpose_optimization.cc @@ -1193,7 +1193,12 @@ bool TransposeQuantizeDequantizeAxis(const api::GraphRef& graph, const std::vect constexpr bool HandleQuantizeDequantizeAxis(const api::GraphRef& graph, const std::vector& perm, api::NodeRef& node, int64_t opset) { - if (opset >= 13) { + if (opset < 13) { + // no `axis` value until opset 13 + return true; + } + + return TransposeQuantizeDequantizeAxis(graph, perm, node);; return TransposeQuantizeDequantizeAxis(graph, perm, node); }