From 59dbe352c08fdee9947fc0fe6f38f7196b3c0676 Mon Sep 17 00:00:00 2001 From: Tomasz Jankowski Date: Thu, 28 Nov 2024 13:29:57 +0100 Subject: [PATCH] [Templ test] IDFT: Enable whole Tensor comparison (#27611) ### Details: - Removed legacy comparison method. - Reduced values comparison absolute threshold. ### Tickets: - CVS-137171 Signed-off-by: Tomasz Jankowski --- .../tests/functional/op_reference/irdft.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/plugins/template/tests/functional/op_reference/irdft.cpp b/src/plugins/template/tests/functional/op_reference/irdft.cpp index 36826ade32fb59..4bcf9fbbe27c18 100644 --- a/src/plugins/template/tests/functional/op_reference/irdft.cpp +++ b/src/plugins/template/tests/functional/op_reference/irdft.cpp @@ -29,8 +29,8 @@ struct IRDFTParams { m_expected_shape = expected_shape; m_input_type = input_type; m_expected_type = expected_type; - m_input_value = CreateTensor(input_type, input_value); - m_expected_value = CreateTensor(expected_type, expected_value); + m_input_value = CreateTensor(m_input_shape, input_type, input_value); + m_expected_value = CreateTensor(m_expected_shape, expected_type, expected_value); m_axes = axes; m_signal = signal; } @@ -48,8 +48,7 @@ struct IRDFTParams { class ReferenceIRDFTLayerTest : public testing::TestWithParam, public CommonReferenceTest { public: void SetUp() override { - legacy_compare = true; - auto params = GetParam(); + const auto& params = GetParam(); if (params.m_signal != NULL) { function = CreateFunctionWithSignal(params); } else { @@ -58,10 +57,12 @@ class ReferenceIRDFTLayerTest : public testing::TestWithParam, publ inputData = {params.m_input_value}; refOutData = {params.m_expected_value}; + + abs_threshold = 1e-6f; } static std::string getTestCaseName(const testing::TestParamInfo& obj) { - const auto param = obj.param; + const auto& param = obj.param; std::ostringstream result; result << "input_shape1=" << param.m_input_shape << "; "; @@ -74,14 +75,14 @@ class ReferenceIRDFTLayerTest : public testing::TestWithParam, publ } private: - static std::shared_ptr CreateFunction(IRDFTParams& p) { + static std::shared_ptr CreateFunction(const IRDFTParams& p) { auto in = std::make_shared(p.m_input_type, p.m_input_shape); auto irdft = std::make_shared(in, p.m_axes); return std::make_shared(irdft, ParameterVector{in}); } - static std::shared_ptr CreateFunctionWithSignal(IRDFTParams& p) { + static std::shared_ptr CreateFunctionWithSignal(const IRDFTParams& p) { auto in = std::make_shared(p.m_input_type, p.m_input_shape); auto irdft = std::make_shared(in, p.m_axes, p.m_signal);