diff --git a/onnxruntime/core/optimizer/qdq_transformer/selectors_actions/shared/utils.cc b/onnxruntime/core/optimizer/qdq_transformer/selectors_actions/shared/utils.cc index f725bc40e5..cc7a892d1c 100644 --- a/onnxruntime/core/optimizer/qdq_transformer/selectors_actions/shared/utils.cc +++ b/onnxruntime/core/optimizer/qdq_transformer/selectors_actions/shared/utils.cc @@ -69,6 +69,7 @@ static const OpVersionsAndSelector::OpVersionsMap GetUnaryOpVersionsMap() { {"Sign", {}}, {"Tanh", {}}, {"Exp", {}}, + {"Log", {}}, {"LRN", {}}, {"Ceil", {}}, {"Abs", {}}, diff --git a/onnxruntime/test/providers/qnn/simple_op_htp_test.cc b/onnxruntime/test/providers/qnn/simple_op_htp_test.cc index a6ef0be16c..4e7702bd84 100644 --- a/onnxruntime/test/providers/qnn/simple_op_htp_test.cc +++ b/onnxruntime/test/providers/qnn/simple_op_htp_test.cc @@ -278,6 +278,14 @@ TEST_F(QnnHTPBackendTests, UnaryOp_Cos_Inaccurate) { 11, ExpectedEPNodeAssignment::All); } +// Check that QNN compiles DQ -> Log -> Q as a single unit. +// Use an input of rank 3. +TEST_F(QnnHTPBackendTests, UnaryOp_Log) { + RunQDQUnaryOpTest(TestInputDef({1, 2, 3}, false, {3.14159f, 100.88436f, 10.542863f, 9.1f, 1.05622f, 3.14159f}), + "Log", {}, + 11, ExpectedEPNodeAssignment::All); +} + // Check that QNN compiles DQ -> Softmax -> Q as a single unit. // Test that the default axis (-1) for SoftMax opset 13 works. TEST_F(QnnHTPBackendTests, UnaryOp_Softmax13_DefaultAxis) {