@@ -41,13 +41,8 @@ OutputVector translate_mulmat(const NodeContext& context) {
4141 B = process_view_input (context, 0 );
4242 A = process_view_input (context, 1 );
4343 }
44-
45- bool convert_out_type = false ;
46- if (ov::op::util::is_constant (B.get_node ()) && context.get_input_type (0 ) != context.get_input_type (1 )) {
47- B = std::make_shared<ov::op::v0::Convert>(B, context.get_input_type (1 ));
48- } else if (context.get_input_type (0 ) != context.get_input_type (1 )) {
49- A = std::make_shared<ov::op::v0::Convert>(A, context.get_input_type (0 ));
50- convert_out_type = true ;
44+ if (A.get_element_type () != B.get_element_type ()) {
45+ B = std::make_shared<ov::op::v0::Convert>(context.get_input (0 ), context.get_input_type (1 ));
5146 }
5247
5348 auto B_shape = context.get_input_shape (0 ).to_shape ();
@@ -82,12 +77,7 @@ OutputVector translate_mulmat(const NodeContext& context) {
8277 A = Z;
8378 }
8479
85- if (convert_out_type) {
86- auto result_lp = std::make_shared<ov::op::v0::MatMul>(A, B, false , transpose_b);
87- res = std::make_shared<ov::op::v0::Convert>(result_lp, context.get_output_type (0 ));
88- } else {
89- res = std::make_shared<ov::op::v0::MatMul>(A, B, false , transpose_b);
90- }
80+ res = std::make_shared<ov::op::v0::MatMul>(A, B, false , transpose_b);
9181
9282 return rename_outputs_with_suffix ({res}, context.get_name ());
9383}
0 commit comments