@@ -3439,6 +3439,65 @@ TEST(eltwise_gpu_f32, broadcast_test_dim3_dim4) {
3439
3439
}
3440
3440
}
3441
3441
3442
+ TEST (eltwise_gpu_f32, broadcast_test_dim3_dim4_new_shape_infer_false) {
3443
+ auto & engine = get_test_engine ();
3444
+
3445
+ ov::Shape in2_shape = {1 , 4 , 1 , 1 };
3446
+ auto input2 = engine.allocate_memory ({ ov::PartialShape (in2_shape), data_types::f32, format::bfyx });
3447
+
3448
+ std::vector<float > const_input = {
3449
+ 1 .f , 0 .f , 5 .f , 1 .5f ,
3450
+ 2 .f , 0 .f , 6 .f , 5 .2f ,
3451
+ 3 .f , 0 .5f , 7 .f , 12 .f ,
3452
+ 4 .f , -0 .5f , 8 .f , 8 .f
3453
+ };
3454
+
3455
+ set_values (input2, {
3456
+ 0 .5f , 2 .5f , 0 .5f , 2 .5f
3457
+ });
3458
+
3459
+ float answers[16 ] = {
3460
+ 1.5 , 0.5 , 7.5 , 4 ,
3461
+ 2.5 , 0.5 , 8.5 , 7.7 ,
3462
+ 3.5 , 1 , 9.5 , 14.5 ,
3463
+ 4.5 , 0 , 10.5 , 10.5
3464
+ };
3465
+
3466
+ ExecutionConfig config = get_test_default_config (engine);
3467
+ config.set_property (ov::intel_gpu::allow_new_shape_infer (false ));
3468
+
3469
+ // in1:dim3, int2:dim4
3470
+ {
3471
+ ov::Shape in1_shape = {2 , 4 , 2 };
3472
+
3473
+ auto input = engine.allocate_memory ({ ov::PartialShape (in1_shape), data_types::f32, format::bfyx });
3474
+ set_values (input, const_input);
3475
+
3476
+ topology topology;
3477
+ topology.add (input_layout (" input" , input->get_layout ()));
3478
+ topology.add (input_layout (" input2" , input2->get_layout ()));
3479
+ topology.add (eltwise (" eltwise" , { input_info (" input" ), input_info (" input2" ) }, eltwise_mode::sum));
3480
+
3481
+ network network (engine, topology, config);
3482
+
3483
+ network.set_input_data (" input" , input);
3484
+ network.set_input_data (" input2" , input2);
3485
+ auto outputs = network.execute ();
3486
+
3487
+ ASSERT_EQ (outputs.size (), size_t (1 ));
3488
+ ASSERT_EQ (outputs.begin ()->first , " eltwise" );
3489
+
3490
+ auto output = outputs.at (" eltwise" ).get_memory ();
3491
+
3492
+ cldnn::mem_lock<float > output_ptr (output, get_test_stream ());
3493
+
3494
+ for (int i = 0 ; i < 16 ; i++)
3495
+ {
3496
+ ASSERT_TRUE (are_equal (answers[i], output_ptr[i]));
3497
+ }
3498
+ }
3499
+ }
3500
+
3442
3501
TEST (eltwise_gpu_f16, fs_b_yx_fsv32_basic)
3443
3502
{
3444
3503
// Inputs are 2x2x2x2
0 commit comments