@@ -271,14 +271,24 @@ TEST_F(QnnHTPBackendTests, Reshape_DynamicShape_Unsupported) {
271271 19 ); // Opset
272272}
273273
274- // Test that QDQ Reshape with an enabled 'allowzero' attribute is not supported by QNN EP.
275- TEST_F (QnnHTPBackendTests, Reshape_AllowZeroAttr_Unsupported) {
274+ // Test that QDQ Reshape with allowzero=1 and a shape containing zeros is not supported by QNN EP.
275+ TEST_F (QnnHTPBackendTests, Reshape_AllowZeroAttr_WithZeros_Unsupported) {
276+ RunReshapeExpandTestOnHTP<float >(" Reshape" ,
277+ TestInputDef<float >({2 , 0 , 3 }, false , {}),
278+ TestInputDef<int64_t >({2 }, true , {6 , 0 }),
279+ {utils::MakeAttribute (" allowzero" , static_cast <int64_t >(1 ))},
280+ ExpectedEPNodeAssignment::None,
281+ 19 );
282+ }
283+
284+ // Test that QDQ Reshape with allowzero=1 but no zeros in shape IS supported by QNN EP.
285+ TEST_F (QnnHTPBackendTests, Reshape_AllowZeroAttr_NoZeros_Supported) {
276286 RunQDQReshapeExpandTestOnHTP<uint8_t >(" Reshape" ,
277- TestInputDef<float >({1 , 3 , 4 , 4 }, false , -10 .0f , 10 .0f ),
278- TestInputDef<int64_t >({2 }, true , {1 , 48 }),
287+ TestInputDef<float >({1 , 3 , 4 , 4 }, false , GetFloatDataInRange ( -10 .0f , 10 .0f , 48 ) ),
288+ TestInputDef<int64_t >({2 }, true , {1 , 48 }), // concrete shape with no zeros
279289 {utils::MakeAttribute (" allowzero" , static_cast <int64_t >(1 ))},
280- ExpectedEPNodeAssignment::None, // Should not be assigned to QNN EP.
281- 19 ); // Opset
290+ ExpectedEPNodeAssignment::All,
291+ 19 );
282292}
283293
284294// Test 8-bit QDQ Reshape of rank 4 -> rank 2.
0 commit comments