Skip to content

Commit 9ef22b7

Browse files
Align 4d tensor for use_new_shape_infer false
1 parent e2fb23f commit 9ef22b7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/plugins/intel_gpu/src/graph/eltwise.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@ eltwise_inst::typed_primitive_inst(network& network, eltwise_node const& node) :
396396
bool use_new_shape_infer = network.get_config().get_property(ov::intel_gpu::allow_new_shape_infer);
397397
auto input0_pshape = node.get_input_pshape(0);
398398

399+
if (!use_new_shape_infer && input0_pshape.size() < 4)
400+
input0_pshape.insert(input0_pshape.end(), 4 - input0_pshape.size(), 1);
401+
399402
for (size_t i = 1; i < inputs_count; ++i) {
400403
auto input_pshape = node.get_input_pshape(i);
401404

@@ -410,11 +413,7 @@ eltwise_inst::typed_primitive_inst(network& network, eltwise_node const& node) :
410413
auto base_pshape = input0_pshape;
411414
if (prim->broadcast_spec == ov::op::AutoBroadcastType::NUMPY &&
412415
base_pshape.size() < input_pshape.size()) {
413-
if (use_new_shape_infer) {
414-
base_pshape.insert(base_pshape.begin(), input_pshape.size() - base_pshape.size(), 1);
415-
} else {
416-
base_pshape.insert(base_pshape.end(), input_pshape.size() - base_pshape.size(), 1);
417-
}
416+
base_pshape.insert(base_pshape.begin(), input_pshape.size() - base_pshape.size(), 1);
418417
}
419418

420419
for (size_t d = 0; d < base_pshape.size(); ++d) {

0 commit comments

Comments
 (0)