Refactor EmbeddingBagOffsetsSumLayerTest, EmbeddingBagPackedSumLayerTest, EmbeddingSegmentsSumLayerTest (#19952)
* Refactor EmbeddingBagOffsetsSumLayerTest * Refactor EmbeddingBagPackedSumLayerTest * Refactor EmbeddingSegmentsSumLayerTest
This commit is contained in:
1 parent
26d18c924b
commit
c1271d1217
12 files changed
+412
-44
No files matched your search
+17
-14
@@ -4,25 +4,28 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "single_layer_tests/embedding_bag_offsets_sum.hpp"
|
||||
#include "single_op_tests/embedding_bag_offsets_sum.hpp"
|
||||
#include "common_test_utils/test_constants.hpp"
|
||||
|
||||
using namespace LayerTestsDefinitions;
|
||||
|
||||
namespace {
|
||||
using ov::test::EmbeddingBagOffsetsSumLayerTest;
|
||||
|
||||
const std::vector<InferenceEngine::Precision> netPrecisions = {
|
||||
InferenceEngine::Precision::FP32,
|
||||
InferenceEngine::Precision::I32,
|
||||
InferenceEngine::Precision::U8
|
||||
const std::vector<ov::element::Type> model_type = {
|
||||
ov::element::f32,
|
||||
ov::element::i32,
|
||||
ov::element::u8
|
||||
};
|
||||
|
||||
const std::vector<InferenceEngine::Precision> indPrecisions = {
|
||||
InferenceEngine::Precision::I64,
|
||||
InferenceEngine::Precision::I32
|
||||
const std::vector<ov::element::Type> ind_type = {
|
||||
ov::element::i64,
|
||||
ov::element::i32
|
||||
};
|
||||
|
||||
const std::vector<std::vector<size_t>> emb_table_shape = {{5, 6}, {10, 35}, {5, 4, 16}};
|
||||
const std::vector<std::vector<ov::Shape>> input_shapes_static = {
|
||||
{{5, 6}},
|
||||
{{10, 35}},
|
||||
{{5, 4, 16}}};
|
||||
|
||||
const std::vector<std::vector<size_t>> indices =
|
||||
{{0, 1, 2, 2, 3}, {4, 4, 3, 1, 0}, {1, 2, 1, 2, 1, 2, 1, 2, 1, 2}};
|
||||
const std::vector<std::vector<size_t>> offsets = {{0, 2}, {0, 0, 2, 2}, {2, 4}};
|
||||
@@ -31,7 +34,6 @@ const std::vector<bool> with_weights = {false, true};
|
||||
const std::vector<bool> with_default_index = {false, true};
|
||||
|
||||
const auto embBagOffsetSumArgSet = ::testing::Combine(
|
||||
::testing::ValuesIn(emb_table_shape),
|
||||
::testing::ValuesIn(indices),
|
||||
::testing::ValuesIn(offsets),
|
||||
::testing::ValuesIn(default_index),
|
||||
@@ -42,8 +44,9 @@ const auto embBagOffsetSumArgSet = ::testing::Combine(
|
||||
INSTANTIATE_TEST_SUITE_P(smoke, EmbeddingBagOffsetsSumLayerTest,
|
||||
::testing::Combine(
|
||||
embBagOffsetSumArgSet,
|
||||
::testing::ValuesIn(netPrecisions),
|
||||
::testing::ValuesIn(indPrecisions),
|
||||
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(input_shapes_static)),
|
||||
::testing::ValuesIn(model_type),
|
||||
::testing::ValuesIn(ind_type),
|
||||
::testing::Values(ov::test::utils::DEVICE_CPU)),
|
||||
EmbeddingBagOffsetsSumLayerTest::getTestCaseName);
|
||||
} // namespace
|
||||
+17
-14
@@ -4,31 +4,33 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "single_layer_tests/embedding_bag_packed_sum.hpp"
|
||||
#include "single_op_tests/embedding_bag_packed_sum.hpp"
|
||||
#include "common_test_utils/test_constants.hpp"
|
||||
|
||||
using namespace LayerTestsDefinitions;
|
||||
|
||||
namespace {
|
||||
using ov::test::EmbeddingBagPackedSumLayerTest;
|
||||
|
||||
const std::vector<InferenceEngine::Precision> netPrecisions = {
|
||||
InferenceEngine::Precision::FP32,
|
||||
InferenceEngine::Precision::I32,
|
||||
InferenceEngine::Precision::U8
|
||||
const std::vector<ov::element::Type> model_type = {
|
||||
ov::element::f32,
|
||||
ov::element::i32,
|
||||
ov::element::u8
|
||||
};
|
||||
|
||||
const std::vector<InferenceEngine::Precision> indPrecisions = {
|
||||
InferenceEngine::Precision::I64,
|
||||
InferenceEngine::Precision::I32
|
||||
const std::vector<ov::element::Type> ind_type = {
|
||||
ov::element::i64,
|
||||
ov::element::i32
|
||||
};
|
||||
|
||||
const std::vector<std::vector<size_t>> emb_table_shape = {{5, 6}, {10, 35}, {5, 4, 16}};
|
||||
const std::vector<std::vector<ov::Shape>> input_shapes_static =
|
||||
{{{5, 6}},
|
||||
{{10, 35}},
|
||||
{{5, 4, 16}}};
|
||||
|
||||
const std::vector<std::vector<std::vector<size_t>>> indices =
|
||||
{{{0, 1}, {2, 2}, {3, 4}}, {{4, 4, 3}, {1, 0, 2}}, {{1, 2, 1, 2}, {1, 2, 1, 2}}};
|
||||
const std::vector<bool> with_weights = {false, true};
|
||||
|
||||
const auto embBagPackedSumArgSet = ::testing::Combine(
|
||||
::testing::ValuesIn(emb_table_shape),
|
||||
::testing::ValuesIn(indices),
|
||||
::testing::ValuesIn(with_weights)
|
||||
);
|
||||
@@ -36,8 +38,9 @@ const auto embBagPackedSumArgSet = ::testing::Combine(
|
||||
INSTANTIATE_TEST_SUITE_P(smoke, EmbeddingBagPackedSumLayerTest,
|
||||
::testing::Combine(
|
||||
embBagPackedSumArgSet,
|
||||
::testing::ValuesIn(netPrecisions),
|
||||
::testing::ValuesIn(indPrecisions),
|
||||
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(input_shapes_static)),
|
||||
::testing::ValuesIn(model_type),
|
||||
::testing::ValuesIn(ind_type),
|
||||
::testing::Values(ov::test::utils::DEVICE_CPU)),
|
||||
EmbeddingBagPackedSumLayerTest::getTestCaseName);
|
||||
} // namespace
|
||||
+18
-16
@@ -4,27 +4,29 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "single_layer_tests/embedding_segments_sum.hpp"
|
||||
#include "single_op_tests/embedding_segments_sum.hpp"
|
||||
#include "common_test_utils/test_constants.hpp"
|
||||
|
||||
using namespace LayerTestsDefinitions;
|
||||
|
||||
namespace {
|
||||
using ov::test::EmbeddingSegmentsSumLayerTest;
|
||||
|
||||
const std::vector<InferenceEngine::Precision> netPrecisions = {
|
||||
InferenceEngine::Precision::FP32,
|
||||
InferenceEngine::Precision::I32,
|
||||
InferenceEngine::Precision::U8
|
||||
const std::vector<ov::element::Type> model_type = {
|
||||
ov::element::f32,
|
||||
ov::element::i32,
|
||||
ov::element::u8
|
||||
};
|
||||
|
||||
const std::vector<InferenceEngine::Precision> indPrecisions = {
|
||||
InferenceEngine::Precision::I64,
|
||||
InferenceEngine::Precision::I32
|
||||
const std::vector<ov::element::Type> ind_type = {
|
||||
ov::element::i64,
|
||||
ov::element::i32
|
||||
};
|
||||
|
||||
const std::vector<std::vector<size_t>> emb_table_shape = {{5, 6}, {10, 35}, {5, 4, 16}};
|
||||
const std::vector<std::vector<size_t>> indices =
|
||||
{{0, 1, 2, 2, 3}, {4, 4, 3, 1, 2}};
|
||||
const std::vector<std::vector<ov::Shape>> input_shapes_static =
|
||||
{{{5, 6}},
|
||||
{{10, 35}},
|
||||
{{5, 4, 16}}};
|
||||
|
||||
const std::vector<std::vector<size_t>> indices = {{0, 1, 2, 2, 3}, {4, 4, 3, 1, 2}};
|
||||
const std::vector<std::vector<size_t>> segment_ids = {{0, 1, 2, 3, 4}, {0, 0, 2, 2, 4}};
|
||||
const std::vector<size_t> num_segments = {5, 7};
|
||||
const std::vector<size_t> default_index = {0, 4};
|
||||
@@ -32,7 +34,6 @@ const std::vector<bool> with_weights = {false, true};
|
||||
const std::vector<bool> with_default_index = {false, true};
|
||||
|
||||
const auto embSegmentsSumArgSet = ::testing::Combine(
|
||||
::testing::ValuesIn(emb_table_shape),
|
||||
::testing::ValuesIn(indices),
|
||||
::testing::ValuesIn(segment_ids),
|
||||
::testing::ValuesIn(num_segments),
|
||||
@@ -44,8 +45,9 @@ const auto embSegmentsSumArgSet = ::testing::Combine(
|
||||
INSTANTIATE_TEST_SUITE_P(smoke, EmbeddingSegmentsSumLayerTest,
|
||||
::testing::Combine(
|
||||
embSegmentsSumArgSet,
|
||||
::testing::ValuesIn(netPrecisions),
|
||||
::testing::ValuesIn(indPrecisions),
|
||||
::testing::ValuesIn(ov::test::static_shapes_to_test_representation(input_shapes_static)),
|
||||
::testing::ValuesIn(model_type),
|
||||
::testing::ValuesIn(ind_type),
|
||||
::testing::Values(ov::test::utils::DEVICE_CPU)),
|
||||
EmbeddingSegmentsSumLayerTest::getTestCaseName);
|
||||
} // namespace
|
||||
Reference in new issue
Block a user