Skip to content

Commit cafb163

Browse files
committed
mulmat input conversion fix
1 parent de52a13 commit cafb163

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ggml/src/ggml-openvino/openvino/op/mulmat.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <openvino/op/slice.hpp>
1313
#include <openvino/op/transpose.hpp>
1414
#include <openvino/op/unsqueeze.hpp>
15+
#include <openvino/op/util/op_types.hpp>
1516
#include <vector>
1617

1718
#include "../node_context.hpp"
@@ -29,8 +30,10 @@ OutputVector translate_mulmat(const NodeContext& context) {
2930
ov::Output<Node> res;
3031
ov::Output<ov::Node> B = context.get_input(0);
3132
ov::Output<ov::Node> A = context.get_input(1);
32-
if (context.get_input_type(0) != context.get_input_type(1)) {
33+
if (ov::op::util::is_constant(B.get_node()) && context.get_input_type(0) != context.get_input_type(1)) {
3334
B = std::make_shared<ov::op::v0::Convert>(context.get_input(0), context.get_input_type(1));
35+
} else if (context.get_input_type(0) != context.get_input_type(1)) {
36+
A = std::make_shared<ov::op::v0::Convert>(context.get_input(1), context.get_input_type(0));
3437
}
3538

3639
auto B_shape = context.get_input_shape(0).to_shape();

0 commit comments

Comments
 (0)