File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
ggml/src/ggml-openvino/openvino/op Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -30,10 +30,13 @@ OutputVector translate_mulmat(const NodeContext& context) {
3030 ov::Output<Node> res;
3131 ov::Output<ov::Node> B = context.get_input (0 );
3232 ov::Output<ov::Node> A = context.get_input (1 );
33+
34+ bool convert_out_type = false ;
3335 if (ov::op::util::is_constant (B.get_node ()) && context.get_input_type (0 ) != context.get_input_type (1 )) {
3436 B = std::make_shared<ov::op::v0::Convert>(context.get_input (0 ), context.get_input_type (1 ));
3537 } else if (context.get_input_type (0 ) != context.get_input_type (1 )) {
3638 A = std::make_shared<ov::op::v0::Convert>(context.get_input (1 ), context.get_input_type (0 ));
39+ convert_out_type = true ;
3740 }
3841
3942 auto B_shape = context.get_input_shape (0 ).to_shape ();
@@ -68,7 +71,12 @@ OutputVector translate_mulmat(const NodeContext& context) {
6871 A = Z;
6972 }
7073
71- res = std::make_shared<ov::op::v0::MatMul>(A, B, false , true );
74+ if (convert_out_type) {
75+ auto result_lp = std::make_shared<ov::op::v0::MatMul>(A, B, false , true );
76+ res = std::make_shared<ov::op::v0::Convert>(result_lp, context.get_output_type (0 ));
77+ } else {
78+ res = std::make_shared<ov::op::v0::MatMul>(A, B, false , true );
79+ }
7280
7381 return rename_outputs_with_suffix ({res}, context.get_name ());
7482}
You can’t perform that action at this time.
0 commit comments