diff --git a/src/plugins/template/tests/functional/op_reference/base_reference_test.cpp b/src/plugins/template/tests/functional/op_reference/base_reference_test.cpp index 6445ad97c46..239405dbca6 100644 --- a/src/plugins/template/tests/functional/op_reference/base_reference_test.cpp +++ b/src/plugins/template/tests/functional/op_reference/base_reference_test.cpp @@ -100,9 +100,13 @@ void CommonReferenceTest::ValidateBlobs(const ov::Tensor& refBlob, if (actual_comparision_size == 0) actual_comparision_size = refBlob.get_size(); - + // compare() get fundamental element type with element_type_traits firstly and cast data to relative ov type with + // 'from' types listed below have a fundamental analogue as int8_t, but int8_t is converted only to i8 with from + std::vector raw_data_comp_only = + {ov::element::u1, ov::element::u2, ov::element::u3, ov::element::u4, ov::element::u6, ov::element::i4}; const auto& element_type = refBlob.get_element_type(); - if (!legacy_compare) { + if (!legacy_compare && + std::find(raw_data_comp_only.begin(), raw_data_comp_only.end(), element_type) == raw_data_comp_only.end()) { switch (element_type) { case ov::element::boolean: case ov::element::bf16: @@ -117,9 +121,17 @@ void CommonReferenceTest::ValidateBlobs(const ov::Tensor& refBlob, case ov::element::u16: case ov::element::u32: case ov::element::u64: + case ov::element::f8e4m3: + case ov::element::f8e5m2: ov::test::utils::compare(refBlob, outBlob, abs_threshold, threshold); - return; + break; + case ov::element::string: + ov::test::utils::compare_str(refBlob, outBlob); + break; + default: + FAIL() << "Comparator for " << element_type << " element type isn't supported"; } + return; } switch (element_type) { case ov::element::bf16: diff --git a/src/plugins/template/tests/functional/op_reference/memory.cpp b/src/plugins/template/tests/functional/op_reference/memory.cpp index 4c76ef03a26..59ad59106eb 100644 --- a/src/plugins/template/tests/functional/op_reference/memory.cpp +++ b/src/plugins/template/tests/functional/op_reference/memory.cpp @@ -109,19 +109,23 @@ private: TEST_P(ReferenceReadValueAssignV3LayerTest, ReadValueAssignWithHardcodedRefs) { Exec(); - const int COUNT_RUNS = 10; - for (int i = 0; i < COUNT_RUNS; ++i) { - Infer(); - Validate(); + if (executableNetwork) { + const int COUNT_RUNS = 10; + for (int i = 0; i < COUNT_RUNS; ++i) { + Infer(); + Validate(); + } } } TEST_P(ReferenceReadValueAssignV6LayerTest, ReadValueAssignWithHardcodedRefs) { Exec(); - const int COUNT_RUNS = 10; - for (int i = 0; i < COUNT_RUNS; ++i) { - Infer(); - Validate(); + if (executableNetwork) { + const int COUNT_RUNS = 10; + for (int i = 0; i < COUNT_RUNS; ++i) { + Infer(); + Validate(); + } } } diff --git a/src/tests/test_utils/common_test_utils/src/ov_tensor_utils.cpp b/src/tests/test_utils/common_test_utils/src/ov_tensor_utils.cpp index 3ce60ecdb16..49c6d8def15 100644 --- a/src/tests/test_utils/common_test_utils/src/ov_tensor_utils.cpp +++ b/src/tests/test_utils/common_test_utils/src/ov_tensor_utils.cpp @@ -625,6 +625,8 @@ void compare(const ov::Tensor& expected, CASE0(X, ov::element::Type_t::u16) \ CASE0(X, ov::element::Type_t::u32) \ CASE0(X, ov::element::Type_t::u64) \ + CASE0(X, ov::element::Type_t::f8e4m3) \ + CASE0(X, ov::element::Type_t::f8e5m2) \ default: \ OPENVINO_THROW("Unsupported element type: ", \ "expected ", \ @@ -651,6 +653,8 @@ void compare(const ov::Tensor& expected, CASE(ov::element::Type_t::u16) CASE(ov::element::Type_t::u32) CASE(ov::element::Type_t::u64) + CASE(ov::element::Type_t::f8e4m3) + CASE(ov::element::Type_t::f8e5m2) case ov::element::Type_t::string: compare_str(expected, actual); break;