@@ -163,6 +163,38 @@ TEST(reorder_inputs, mixed_ranks_gather) {
163
163
ASSERT_EQ (gather2_node.get_output_layout ().format , format::bfwzyx);
164
164
}
165
165
166
+ TEST (reorder_inputs, mixed_ranks_reshape) {
167
+ // Topology:
168
+ // transpose -> (5d) -> reshape -> (3d)
169
+ // Expected: (bfzyx:5d) -> reorder -> (bfyx:4d) -> reshape -> (bfyx:3d)
170
+
171
+ auto & engine = get_test_engine ();
172
+ auto shape = engine.allocate_memory (layout{ { 3 }, data_types::i64 , format::bfyx });
173
+ set_values<int64_t >(shape, { 0 , -1 , 2 });
174
+
175
+ topology topology;
176
+ topology.add (input_layout (" input" , layout{ { 1 , 2 , 32 , 128 , 128 }, data_types::f16 , format::bzyxf }));
177
+ topology.add (input_layout (" eltw_input" , layout{ { 1 , 524288 , 2 }, data_types::f16 , format::bfyx }));
178
+ topology.add (data (" shape" , shape));
179
+ topology.add (permute (" permute" , input_info (" input" ), { 0 , 2 , 3 , 4 , 1 }));
180
+ topology.add (reshape (" reshape" , input_info (" permute" ), input_info (" shape" ), true , ov::PartialShape{ 1 , 524288 , 2 }));
181
+ topology.add (eltwise (" eltwise" , input_info (" reshape" ), input_info (" eltw_input" ), eltwise_mode::sum));
182
+
183
+ ExecutionConfig config = get_test_default_config (engine);
184
+ config.set_property (ov::intel_gpu::optimize_data (true ));
185
+
186
+ program::ptr prog = nullptr ;
187
+ OV_ASSERT_NO_THROW (prog = program::build_program (engine, topology, config));
188
+ ASSERT_NE (prog, nullptr );
189
+
190
+ auto prog_impl = prog.get ();
191
+
192
+ auto & reshape_node = prog_impl->get_node (" reshape" );
193
+
194
+ ov::PartialShape expected_reorder_shape{ 1 , 32 , 16384 , 2 };
195
+ ASSERT_EQ (reshape_node.get_input_layouts ()[0 ].get_partial_shape (), expected_reorder_shape);
196
+ }
197
+
166
198
TEST (reorder_inputs, impl_forcing_basic_format) {
167
199
auto & engine = get_test_engine ();
168
200
auto input = engine.allocate_memory ({ data_types::f32 , format::bfyx, { 1 , 2 , 4 , 1 } });
0 commit comments