Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eltwise shared test refactor #645

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,40 @@
#include "common_test_utils/test_constants.hpp"

using namespace LayerTestsDefinitions;

using namespace AddTestDefinitions;
namespace {

const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16
std::vector<std::vector<std::vector<size_t>>> inputShapes = { {{1, 200}},
{{1, 2000}},
{{1, 20000}},
{{2, 200}},
{{10, 200}},
{{1, 10, 100}},
{{4, 4, 16}},
};

std::vector<SecondaryInputType> secondaryInputTypes = { SecondaryInputType::CONSTANT,
SecondaryInputType::PARAMETER,
};

const std::vector<std::vector<std::size_t>> inputShapes = {
{std::vector<std::size_t>({1, 30}), std::vector<std::size_t>({1, 30})}
std::vector<AdditionType> additionTypes = { AdditionType::SCALAR,
AdditionType::VECTOR,
};

INSTANTIATE_TEST_CASE_P(CompareWithRefs, AddLayerTest,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(inputShapes),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(std::map<std::string, std::string>({}))),
AddLayerTest::getTestCaseName);
std::vector<InferenceEngine::Precision> netPrecisions = { InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
};


std::map<std::string, std::string> additional_config = {};

const auto addition_params = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(additionTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additional_config));

INSTANTIATE_TEST_CASE_P(CompareWithRefs, AddLayerTest, addition_params, AddLayerTest::getTestCaseName);
} // namespace

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,40 @@
#include "common_test_utils/test_constants.hpp"

using namespace LayerTestsDefinitions;
using namespace MultiplyTestDefinitions;

namespace {
std::vector<std::vector<std::vector<size_t>>> inShapes = {
{{2}},
{{1, 1, 1, 3}},
{{1, 2, 4}},
{{1, 4, 4}},
{{1, 4, 4, 1}},
{{1, 1, 1, 1, 1, 1, 3}},
{{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}
};

std::vector<std::vector<std::vector<size_t>>> inShapes = {
{{2}},
{{1, 1, 1, 3}},
{{1, 2, 4}},
{{1, 4, 4}},
{{1, 4, 4, 1}},
{{1, 1, 1, 1, 1, 1, 3}},
{{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}}
};

std::vector<InferenceEngine::Precision> netPrecisions = {InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
};

INSTANTIATE_TEST_CASE_P(multilpy, MultiplyLayerTest,
::testing::Combine(
::testing::ValuesIn(inShapes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_CPU)),
MultiplyLayerTest::getTestCaseName);
std::vector<InferenceEngine::Precision> netPrecisions = { InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
};

std::vector<SecondaryInputType> secondaryInputTypes = { SecondaryInputType::CONSTANT,
SecondaryInputType::PARAMETER,
};

std::vector<MultiplicationType> multiplicationTypes = { MultiplicationType::SCALAR,
MultiplicationType::VECTOR,
};

std::map<std::string, std::string> additional_config = {};

const auto multiply_params = ::testing::Combine(
::testing::ValuesIn(inShapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(multiplicationTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additional_config));

INSTANTIATE_TEST_CASE_P(CompareWithRefs, MultiplyLayerTest, multiply_params, MultiplyLayerTest::getTestCaseName);
} // namespace
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// Copyright (C) 2020 Intel Corporation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dmitry-gorokhov Please review updated/added CPU plugin instances

Copy link
Contributor

@iefode iefode Jun 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After discussion with @dmitry-gorokhov, we have take a decision to make single eltwise tests file instead of existing. Dmitry had more powerful argument in our discussion.

I will use this PR in merge of these tests. Sorry for inconvenience.

So, This PR is not to be merged.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iefode, can you please elaborate on "I will use this PR in merge of these tests" - what do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will refactor these chanes in the refactoring

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactor in the refactoring? It's still unclear. Is anything expected from our side?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do it myself. I don't expected some actions from your side

// SPDX-License-Identifier: Apache-2.0
//

#include <cstddef>
#include <vector>
#include <map>

#include "single_layer_tests/subtract.hpp"
#include "common_test_utils/test_constants.hpp"

using namespace LayerTestsDefinitions;
using namespace SubtractTestDefinitions;
namespace {

std::vector<std::vector<std::vector<size_t>>> inputShapes = { {{1, 200}},
{{1, 2000}},
{{1, 20000}},
{{2, 200}},
{{10, 200}},
{{1, 10, 100}},
{{4, 4, 16}},
};

std::vector<InferenceEngine::Precision> netPrecisions = { InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
};

std::vector<SecondaryInputType> secondaryInputTypes = { SecondaryInputType::CONSTANT,
SecondaryInputType::PARAMETER,
};

std::vector<SubtractionType> subtractionTypes = { SubtractionType::SCALAR,
SubtractionType::VECTOR,
};

std::map<std::string, std::string> additional_config = {};

const auto subtraction_params = ::testing::Combine(
::testing::ValuesIn(inputShapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(subtractionTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_CPU),
::testing::Values(additional_config));

INSTANTIATE_TEST_CASE_P(CompareWithRefs, SubtractLayerTest, subtraction_params, SubtractLayerTest::getTestCaseName);

} // namespace
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ std::vector<std::string> disabledTestPatterns() {
// TODO: Issue 32023
R"(.*(QuantGroupConvBackpropData2D)*QG=Pertensor.*)",
// TODO: Issue 31845
R"(.*(FakeQuantize).*)"
R"(.*(FakeQuantize).*)",
// TODO: Issue 32521
R"(.*SubtractLayerTest.*netPRC=FP16.*)"
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
// Copyright (C) 2020 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#include <cstddef>
#include <vector>
#include <map>

#include "single_layer_tests/add.hpp"
#include "common_test_utils/test_constants.hpp"

using namespace LayerTestsDefinitions;
using namespace AddTestDefinitions;
namespace {

std::vector<std::vector<InferenceEngine::SizeVector>> flat_shapes = { {{1, 200}}, {{1, 2000}}, {{1, 20000}} };
std::vector<std::vector<InferenceEngine::SizeVector>> non_flat_shapes = { {{2, 200}}, {{10, 200}}, {{1, 10, 100}}, {{4, 4, 16}} };

std::vector<SecondaryInputType> secondaryInputTypes = { SecondaryInputType::CONSTANT,
SecondaryInputType::PARAMETER,
};

std::vector<AdditionType> additionTypes = { AdditionType::SCALAR,
AdditionType::VECTOR,
};

std::vector<InferenceEngine::Precision> netPrecisions = { InferenceEngine::Precision::FP32,
InferenceEngine::Precision::FP16,
};

std::map<std::string, std::string> additional_config = {
{"GNA_DEVICE_MODE", "GNA_SW_EXACT"},
{"GNA_SCALE_FACTOR_0", "1638.4"},
{"GNA_SCALE_FACTOR_1", "1638.4"}
};

const auto addition_params_flat = ::testing::Combine(
::testing::ValuesIn(flat_shapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(additionTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

const auto addition_params_non_flat = ::testing::Combine(
::testing::ValuesIn(non_flat_shapes),
::testing::ValuesIn(secondaryInputTypes),
::testing::ValuesIn(additionTypes),
::testing::ValuesIn(netPrecisions),
::testing::Values(CommonTestUtils::DEVICE_GNA),
::testing::Values(additional_config));

INSTANTIATE_TEST_CASE_P(CompareWithRefs_flat, AddLayerTest, addition_params_flat, AddLayerTest::getTestCaseName);
INSTANTIATE_TEST_CASE_P(CompareWithRefs_non_flat, AddLayerTest, addition_params_non_flat, AddLayerTest::getTestCaseName);
} // namespace

This file was deleted.

Loading