Skip to content

Commit

Permalink
Range, RDFT, RandormUniform, ReduceOps layer tests to API2.0 (o…
Browse files Browse the repository at this point in the history
…penvinotoolkit#20692)

* `Range` to API2.0

* `RDFTLayerTest` to API2.0

* `RandomUniformLayerTest` to API2.0

* `ReduceOpsLayerTest` to API2.0
  • Loading branch information
vurusovs authored and alvoron committed Nov 6, 2023
1 parent 49237ac commit 16892a9
Show file tree
Hide file tree
Showing 20 changed files with 632 additions and 221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,28 @@

#include <vector>

#include "single_layer_tests/range.hpp"
#include "single_op_tests/range.hpp"
#include "common_test_utils/test_constants.hpp"

using namespace LayerTestsDefinitions;
using ov::test::RangeLayerTest;

namespace {

const std::vector<float> start = { 1.0f, 1.2f };
const std::vector<float> stop = { 5.0f, 5.2f };
const std::vector<float> step = { 1.0f, 0.1f };

const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16
const std::vector<ov::element::Type> model_types = {
ov::element::f32,
ov::element::f16
};

INSTANTIATE_TEST_SUITE_P(smoke_Basic, RangeLayerTest,
::testing::Combine(
::testing::ValuesIn(start),
::testing::ValuesIn(stop),
::testing::ValuesIn(step),
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Precision::UNSPECIFIED),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::Values(InferenceEngine::Layout::ANY),
::testing::ValuesIn(model_types),
::testing::Values(ov::test::utils::DEVICE_CPU)),
RangeLayerTest::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -4,153 +4,154 @@

#include <vector>

#include "single_layer_tests/rdft.hpp"
#include "single_op_tests/rdft.hpp"
#include "common_test_utils/test_enums.hpp"
#include "common_test_utils/test_constants.hpp"

using namespace LayerTestsDefinitions;
using ov::test::RDFTLayerTest;

const std::vector<ngraph::helpers::DFTOpType> opTypes = {
ngraph::helpers::DFTOpType::FORWARD,
ngraph::helpers::DFTOpType::INVERSE
const std::vector<ov::test::utils::DFTOpType> op_types = {
ov::test::utils::DFTOpType::FORWARD,
ov::test::utils::DFTOpType::INVERSE
};

static const std::vector<InferenceEngine::Precision> inputPrecision = {
InferenceEngine::Precision::FP32,
static const std::vector<ov::element::Type> model_types = {
ov::element::f32,
};

const std::vector<std::vector<size_t>> shapesForward1d = {
const std::vector<std::vector<size_t>> shapes_forward_1d = {
{10},
{64},
{100},
};


const std::vector<std::vector<int64_t>> signalSizes1d = {
const std::vector<std::vector<int64_t>> signal_sizes_1d = {
{}, {10},
};

//1D case doesn't work yet on reference implementation
INSTANTIATE_TEST_SUITE_P(DISABLED_smoke_RDFT_1d, RDFTLayerTest,
::testing::Combine(
::testing::ValuesIn(shapesForward1d),
::testing::ValuesIn(inputPrecision),
::testing::ValuesIn(shapes_forward_1d),
::testing::ValuesIn(model_types),
::testing::Values(std::vector<int64_t>{0}),
::testing::ValuesIn(signalSizes1d),
::testing::Values(ngraph::helpers::DFTOpType::FORWARD),
::testing::ValuesIn(signal_sizes_1d),
::testing::Values(ov::test::utils::DFTOpType::FORWARD),
::testing::Values(ov::test::utils::DEVICE_CPU)), RDFTLayerTest::getTestCaseName);

const std::vector<std::vector<size_t>> shapesInverse1d = {
const std::vector<std::vector<size_t>> shapes_inverse_1d = {
{10, 2},
{64, 2},
{100, 2},
};

INSTANTIATE_TEST_SUITE_P(DISABLED_smoke_IRDFT_1d, RDFTLayerTest,
::testing::Combine(
::testing::ValuesIn(shapesInverse1d),
::testing::ValuesIn(inputPrecision),
::testing::ValuesIn(shapes_inverse_1d),
::testing::ValuesIn(model_types),
::testing::Values(std::vector<int64_t>{0}),
::testing::ValuesIn(signalSizes1d),
::testing::Values(ngraph::helpers::DFTOpType::INVERSE),
::testing::ValuesIn(signal_sizes_1d),
::testing::Values(ov::test::utils::DFTOpType::INVERSE),
::testing::Values(ov::test::utils::DEVICE_CPU)), RDFTLayerTest::getTestCaseName);

const std::vector<std::vector<size_t>> shapesForward2d = {
const std::vector<std::vector<size_t>> shapes_forward_2d = {
{10, 15},
{64, 32},
{100, 16},
};

const std::vector<std::vector<int64_t>> axes2d = {
const std::vector<std::vector<int64_t>> axes_2d = {
{0, 1}, {1, 0}, {-2, -1},
};


const std::vector<std::vector<int64_t>> signalSizes2d = {
const std::vector<std::vector<int64_t>> signal_sizes_2d = {
{}, {10, 10},
};

INSTANTIATE_TEST_SUITE_P(smoke_RDFT_2d, RDFTLayerTest,
::testing::Combine(
::testing::ValuesIn(shapesForward2d),
::testing::ValuesIn(inputPrecision),
::testing::ValuesIn(axes2d),
::testing::ValuesIn(signalSizes2d),
::testing::Values(ngraph::helpers::DFTOpType::FORWARD),
::testing::ValuesIn(shapes_forward_2d),
::testing::ValuesIn(model_types),
::testing::ValuesIn(axes_2d),
::testing::ValuesIn(signal_sizes_2d),
::testing::Values(ov::test::utils::DFTOpType::FORWARD),
::testing::Values(ov::test::utils::DEVICE_CPU)), RDFTLayerTest::getTestCaseName);

const std::vector<std::vector<size_t>> shapesInverse2d = {
const std::vector<std::vector<size_t>> shapes_inverse_2d = {
{10, 15, 2},
{64, 32, 2},
{100, 32, 2},
};

INSTANTIATE_TEST_SUITE_P(smoke_IRDFT_2d, RDFTLayerTest,
::testing::Combine(
::testing::ValuesIn(shapesInverse2d),
::testing::ValuesIn(inputPrecision),
::testing::ValuesIn(axes2d),
::testing::ValuesIn(signalSizes2d),
::testing::Values(ngraph::helpers::DFTOpType::INVERSE),
::testing::ValuesIn(shapes_inverse_2d),
::testing::ValuesIn(model_types),
::testing::ValuesIn(axes_2d),
::testing::ValuesIn(signal_sizes_2d),
::testing::Values(ov::test::utils::DFTOpType::INVERSE),
::testing::Values(ov::test::utils::DEVICE_CPU)), RDFTLayerTest::getTestCaseName);

const std::vector<std::vector<size_t>> shapesForward4d = {
const std::vector<std::vector<size_t>> shapes_forward_4d = {
{1, 3, 10, 15},
{1, 4, 64, 32},
};

const std::vector<std::vector<int64_t>> axes4d = {
const std::vector<std::vector<int64_t>> axes_4d = {
{0, 1, 2, 3}, {1, 0, -2, -1}
};


const std::vector<std::vector<int64_t>> signalSizes4d = {
const std::vector<std::vector<int64_t>> signal_sizes_4d = {
{},
};

INSTANTIATE_TEST_SUITE_P(smoke_RDFT_4d, RDFTLayerTest,
::testing::Combine(
::testing::ValuesIn(shapesForward4d),
::testing::ValuesIn(inputPrecision),
::testing::ValuesIn(axes4d),
::testing::ValuesIn(signalSizes4d),
::testing::Values(ngraph::helpers::DFTOpType::FORWARD),
::testing::ValuesIn(shapes_forward_4d),
::testing::ValuesIn(model_types),
::testing::ValuesIn(axes_4d),
::testing::ValuesIn(signal_sizes_4d),
::testing::Values(ov::test::utils::DFTOpType::FORWARD),
::testing::Values(ov::test::utils::DEVICE_CPU)), RDFTLayerTest::getTestCaseName);

const std::vector<std::vector<int64_t>> axes4d_2d = {
const std::vector<std::vector<int64_t>> axes_4d_2d = {
{2, 3}, {1, -1}
};

INSTANTIATE_TEST_SUITE_P(smoke_RDFT_4d_axes_2d, RDFTLayerTest,
::testing::Combine(
::testing::ValuesIn(shapesForward4d),
::testing::ValuesIn(inputPrecision),
::testing::ValuesIn(axes4d_2d),
::testing::ValuesIn(shapes_forward_4d),
::testing::ValuesIn(model_types),
::testing::ValuesIn(axes_4d_2d),
::testing::Values(std::vector<int64_t>{}),
::testing::Values(ngraph::helpers::DFTOpType::FORWARD),
::testing::Values(ov::test::utils::DFTOpType::FORWARD),
::testing::Values(ov::test::utils::DEVICE_CPU)), RDFTLayerTest::getTestCaseName);


const std::vector<std::vector<size_t>> shapesInverse4d = {
const std::vector<std::vector<size_t>> shapes_inverse_4d = {
{1, 3, 10, 15, 2},
{1, 4, 64, 32, 2},
};

INSTANTIATE_TEST_SUITE_P(smoke_IRDFT_4d, RDFTLayerTest,
::testing::Combine(
::testing::ValuesIn(shapesInverse4d),
::testing::ValuesIn(inputPrecision),
::testing::ValuesIn(axes4d),
::testing::ValuesIn(signalSizes4d),
::testing::Values(ngraph::helpers::DFTOpType::INVERSE),
::testing::ValuesIn(shapes_inverse_4d),
::testing::ValuesIn(model_types),
::testing::ValuesIn(axes_4d),
::testing::ValuesIn(signal_sizes_4d),
::testing::Values(ov::test::utils::DFTOpType::INVERSE),
::testing::Values(ov::test::utils::DEVICE_CPU)), RDFTLayerTest::getTestCaseName);

INSTANTIATE_TEST_SUITE_P(smoke_IRDFT_4d_axes_2d, RDFTLayerTest,
::testing::Combine(
::testing::ValuesIn(shapesInverse4d),
::testing::ValuesIn(inputPrecision),
::testing::ValuesIn(axes4d_2d),
::testing::ValuesIn(shapes_inverse_4d),
::testing::ValuesIn(model_types),
::testing::ValuesIn(axes_4d_2d),
::testing::Values(std::vector<int64_t>{}),
::testing::Values(ngraph::helpers::DFTOpType::INVERSE),
::testing::Values(ov::test::utils::DFTOpType::INVERSE),
::testing::Values(ov::test::utils::DEVICE_CPU)), RDFTLayerTest::getTestCaseName);


Expand Down
Loading

0 comments on commit 16892a9

Please sign in to comment.