forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor CTCGreedyDecoderSeqLenLayerTest, GreedyDecoderLayerTest, CTC…
…LossLayerTest (openvinotoolkit#19842) * Refactor CTCGreedyDecoderSeqLenLayerTest * Refactor usingGreedyDecoderLayerTest * Refactor CTCLossLayerTest
- Loading branch information
Showing
12 changed files
with
495 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/tests/functional/plugin/shared/include/single_op_tests/ctc_greedy_decoder.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (C) 2018-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include "shared_test_classes/single_op/ctc_greedy_decoder.hpp" | ||
|
||
namespace ov { | ||
namespace test { | ||
TEST_P(CTCGreedyDecoderLayerTest, Inference) { | ||
run(); | ||
}; | ||
} // namespace test | ||
} // namespace ov |
15 changes: 15 additions & 0 deletions
15
src/tests/functional/plugin/shared/include/single_op_tests/ctc_greedy_decoder_seq_len.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (C) 2018-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include "shared_test_classes/single_op/ctc_greedy_decoder_seq_len.hpp" | ||
|
||
namespace ov { | ||
namespace test { | ||
TEST_P(CTCGreedyDecoderSeqLenLayerTest, Inference) { | ||
run(); | ||
}; | ||
} // namespace test | ||
} // namespace ov |
15 changes: 15 additions & 0 deletions
15
src/tests/functional/plugin/shared/include/single_op_tests/ctc_loss.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (C) 2018-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include "shared_test_classes/single_op/ctc_loss.hpp" | ||
|
||
namespace ov { | ||
namespace test { | ||
TEST_P(CTCLossLayerTest, Inference) { | ||
run(); | ||
} | ||
} // namespace test | ||
} // namespace ov |
31 changes: 31 additions & 0 deletions
31
...nctional/shared_test_classes/include/shared_test_classes/single_op/ctc_greedy_decoder.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (C) 2018-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
#include <tuple> | ||
#include <vector> | ||
|
||
#include "shared_test_classes/base/ov_subgraph.hpp" | ||
|
||
namespace ov { | ||
namespace test { | ||
typedef std::tuple< | ||
ov::element::Type, // Model type | ||
std::vector<InputShape>, // Input shapes | ||
bool, // Merge repeated | ||
std::string // Device name | ||
> ctcGreedyDecoderParams; | ||
|
||
class CTCGreedyDecoderLayerTest | ||
: public testing::WithParamInterface<ctcGreedyDecoderParams>, | ||
virtual public ov::test::SubgraphBaseTest { | ||
public: | ||
static std::string getTestCaseName(const testing::TestParamInfo<ctcGreedyDecoderParams>& obj); | ||
protected: | ||
void SetUp() override; | ||
}; | ||
} // namespace test | ||
} // namespace ov |
36 changes: 36 additions & 0 deletions
36
.../shared_test_classes/include/shared_test_classes/single_op/ctc_greedy_decoder_seq_len.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (C) 2018-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
#include <tuple> | ||
#include <vector> | ||
|
||
#include "shared_test_classes/base/ov_subgraph.hpp" | ||
|
||
namespace ov { | ||
namespace test { | ||
typedef std::tuple< | ||
std::vector<InputShape>, // Input shape | ||
int, // Sequence lengths | ||
ov::element::Type, // Probabilities precision | ||
ov::element::Type, // Indices precision | ||
int, // Blank index | ||
bool, // Merge repeated | ||
std::string // Device name | ||
> ctcGreedyDecoderSeqLenParams; | ||
|
||
class CTCGreedyDecoderSeqLenLayerTest | ||
: public testing::WithParamInterface<ctcGreedyDecoderSeqLenParams>, | ||
virtual public ov::test::SubgraphBaseTest { | ||
public: | ||
static std::string getTestCaseName(const testing::TestParamInfo<ctcGreedyDecoderSeqLenParams>& obj); | ||
|
||
protected: | ||
void SetUp() override; | ||
}; | ||
|
||
} // namespace test | ||
} // namespace ov |
43 changes: 43 additions & 0 deletions
43
src/tests/functional/shared_test_classes/include/shared_test_classes/single_op/ctc_loss.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (C) 2018-2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#pragma once | ||
|
||
#include <string> | ||
#include <tuple> | ||
#include <vector> | ||
|
||
#include "shared_test_classes/base/ov_subgraph.hpp" | ||
|
||
namespace ov { | ||
namespace test { | ||
typedef std::tuple< | ||
std::vector<int>, // logits length | ||
std::vector<std::vector<int>>, // labels | ||
std::vector<int>, // labels length | ||
int, // blank index | ||
bool, // preprocessCollapseRepeated | ||
bool, // ctcMergeRepeated | ||
bool // Unique | ||
> CTCLossParamsSubset; | ||
|
||
typedef std::tuple< | ||
CTCLossParamsSubset, | ||
std::vector<InputShape>, // Input shapes | ||
ov::element::Type, // Float point precision | ||
ov::element::Type, // Integer precision | ||
std::string // Device name | ||
> CTCLossParams; | ||
|
||
class CTCLossLayerTest : public testing::WithParamInterface<CTCLossParams>, | ||
virtual public ov::test::SubgraphBaseTest { | ||
public: | ||
static std::string getTestCaseName(const testing::TestParamInfo<CTCLossParams> &obj); | ||
|
||
protected: | ||
void SetUp() override; | ||
}; | ||
|
||
} // namespace test | ||
} // namespace ov |
Oops, something went wrong.