diff --git a/src/plugins/intel_gpu/src/graph/reshape.cpp b/src/plugins/intel_gpu/src/graph/reshape.cpp index b32ec9e0683..433c82b41d2 100644 --- a/src/plugins/intel_gpu/src/graph/reshape.cpp +++ b/src/plugins/intel_gpu/src/graph/reshape.cpp @@ -74,6 +74,11 @@ std::vector reshape_inst::calc_output_layouts(reshape_node const& /*node ShapeType pattern_shape = impl_param.input_layouts.size() == 2 ? impl_param.get_input_layout(1).get() : ShapeType(ov::Shape{ prim->output_pattern.size() }); + // Since reshape does not support 0D tensor(scalar) for shape input + // the case propagated to 0D tensor should be handled manually with 1D tensor + if (pattern_shape.size() == 0) { + pattern_shape = ShapeType{1}; + } std::vector output_shapes = {ShapeType()}; std::vector input_shapes = { input_layout.get(), diff --git a/src/plugins/intel_gpu/tests/unit/shape_infer/reshape_si_test.cpp b/src/plugins/intel_gpu/tests/unit/shape_infer/reshape_si_test.cpp index 4f1ed9e2f75..1d3de473319 100644 --- a/src/plugins/intel_gpu/tests/unit/shape_infer/reshape_si_test.cpp +++ b/src/plugins/intel_gpu/tests/unit/shape_infer/reshape_si_test.cpp @@ -81,6 +81,11 @@ INSTANTIATE_TEST_SUITE_P(smoke, reshape_test_two_inputs, layout{ov::PartialShape{4}, data_types::i64, format::bfyx}, {0, 0, 16, 64}, ov::PartialShape::dynamic(4), true, layout{ov::PartialShape{1, 384, 16, 64}, data_types::f32, format::bfyx} }, + { + layout{ov::PartialShape{1, 128, 1024}, data_types::f32, format::bfyx}, + layout{ov::PartialShape{}, data_types::i64, format::bfyx}, {131072}, ov::PartialShape::dynamic(1), true, + layout{ov::PartialShape{131072}, data_types::f32, format::bfyx} + }, { layout{ov::PartialShape::dynamic(2), data_types::f32, format::bfyx}, layout{ov::PartialShape{4}, data_types::i64, format::bfyx}, {0, 1, 2, 3}, ov::PartialShape::dynamic(4), true,