Skip to content

Commit

Permalink
[Templ test] IDFT: Enable whole Tensor comparison (#27611)
Browse files Browse the repository at this point in the history
### Details:
 - Removed legacy comparison method.
 - Reduced values comparison absolute threshold.

### Tickets:
 - CVS-137171

Signed-off-by: Tomasz Jankowski <[email protected]>
  • Loading branch information
t-jankowski authored Nov 28, 2024
1 parent f2d2c22 commit 59dbe35
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/plugins/template/tests/functional/op_reference/irdft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -48,8 +48,7 @@ struct IRDFTParams {
class ReferenceIRDFTLayerTest : public testing::TestWithParam<IRDFTParams>, 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 {
Expand All @@ -58,10 +57,12 @@ class ReferenceIRDFTLayerTest : public testing::TestWithParam<IRDFTParams>, publ

inputData = {params.m_input_value};
refOutData = {params.m_expected_value};

abs_threshold = 1e-6f;
}

static std::string getTestCaseName(const testing::TestParamInfo<IRDFTParams>& obj) {
const auto param = obj.param;
const auto& param = obj.param;
std::ostringstream result;

result << "input_shape1=" << param.m_input_shape << "; ";
Expand All @@ -74,14 +75,14 @@ class ReferenceIRDFTLayerTest : public testing::TestWithParam<IRDFTParams>, publ
}

private:
static std::shared_ptr<Model> CreateFunction(IRDFTParams& p) {
static std::shared_ptr<Model> CreateFunction(const IRDFTParams& p) {
auto in = std::make_shared<op::v0::Parameter>(p.m_input_type, p.m_input_shape);
auto irdft = std::make_shared<op::v9::IRDFT>(in, p.m_axes);

return std::make_shared<ov::Model>(irdft, ParameterVector{in});
}

static std::shared_ptr<Model> CreateFunctionWithSignal(IRDFTParams& p) {
static std::shared_ptr<Model> CreateFunctionWithSignal(const IRDFTParams& p) {
auto in = std::make_shared<op::v0::Parameter>(p.m_input_type, p.m_input_shape);
auto irdft = std::make_shared<op::v9::IRDFT>(in, p.m_axes, p.m_signal);

Expand Down

0 comments on commit 59dbe35

Please sign in to comment.