Fixing SetUp for SLT tests of ShapeOF (#10323)

* Fixing SetUp for SLT tests of ShapeOF

* Attempting to pass outputPrecision into the test

* Correcting deficiencies, taking into account in the name of the test of the output precision
This commit is contained in:
Nikita Semaev 2022-02-18 10:37:39 +03:00 committed by GitHub
parent 3a89c87f52
commit 03862e780f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 9 deletions

View File

@ -11,12 +11,14 @@ using namespace LayerTestsDefinitions;
namespace {
const std::vector<InferenceEngine::Precision> netPrecisions = {
InferenceEngine::Precision::FP32,
InferenceEngine::Precision::I32
};
INSTANTIATE_TEST_SUITE_P(smoke_Check, ShapeOfLayerTest,
::testing::Combine(
::testing::ValuesIn(netPrecisions),
::testing::Values(InferenceEngine::Precision::I64),
::testing::Values(std::vector<size_t>({10, 10, 10})),
::testing::Values(CommonTestUtils::DEVICE_CPU)),
ShapeOfLayerTest::getTestCaseName);

View File

@ -32,7 +32,6 @@ std::vector<std::string> disabledTestPatterns() {
// TODO: Issue: 63469
R"(.*ConversionLayerTest.*ConvertLike.*)",
// TODO: Issue: 34055
R"(.*ShapeOfLayerTest.*)",
R"(.*ReluShapeOfSubgraphTest.*)",
// TODO: Issue: 43314
R"(.*Broadcast.*mode=BIDIRECTIONAL.*inNPrec=BOOL.*)",

View File

@ -18,12 +18,19 @@ typedef std::tuple<
InferenceEngine::Precision, // Network precision
std::vector<size_t>, // Input shapes
std::string // Device name
> shapeOfParamsCommon;
typedef std::tuple<
InferenceEngine::Precision, // Network precision
InferenceEngine::Precision, // Output precision
std::vector<size_t>, // Input shapes
std::string // Device name
> shapeOfParams;
class ShapeOfLayerTest : public testing::WithParamInterface<shapeOfParams>,
virtual public LayerTestsUtils::LayerTestsCommon {
public:
static std::string getTestCaseName(const testing::TestParamInfo<shapeOfParams>& obj);
static std::string getTestCaseName(testing::TestParamInfo<ParamType> obj);
protected:
void SetUp() override;

View File

@ -16,10 +16,10 @@
namespace SubgraphTestsDefinitions {
class ReluShapeOfSubgraphTest : public testing::WithParamInterface<LayerTestsDefinitions::shapeOfParams>,
class ReluShapeOfSubgraphTest : public testing::WithParamInterface<LayerTestsDefinitions::shapeOfParamsCommon>,
virtual public LayerTestsUtils::LayerTestsCommon {
public:
static std::string getTestCaseName(const testing::TestParamInfo<LayerTestsDefinitions::shapeOfParams>& obj);
static std::string getTestCaseName(const testing::TestParamInfo<LayerTestsDefinitions::shapeOfParamsCommon>& obj);
protected:
void SetUp() override;
};

View File

@ -6,14 +6,16 @@
namespace LayerTestsDefinitions {
std::string ShapeOfLayerTest::getTestCaseName(const testing::TestParamInfo<shapeOfParams>& obj) {
std::string ShapeOfLayerTest::getTestCaseName(testing::TestParamInfo<shapeOfParams> obj) {
InferenceEngine::SizeVector inputShapes;
InferenceEngine::Precision inputPrecision;
InferenceEngine::Precision outputPrecision;
std::string targetDevice;
std::tie(inputPrecision, inputShapes, targetDevice) = obj.param;
std::tie(inputPrecision, outputPrecision, inputShapes, targetDevice) = obj.param;
std::ostringstream result;
result << "IS=" << CommonTestUtils::vec2str(inputShapes) << "_";
result << "Precision=" << inputPrecision.name() << "_";
result << "Output Precision=" << outputPrecision.name() << "_";
result << "TargetDevice=" << targetDevice;
return result.str();
}
@ -21,11 +23,12 @@ namespace LayerTestsDefinitions {
void ShapeOfLayerTest::SetUp() {
InferenceEngine::SizeVector inputShapes;
InferenceEngine::Precision inputPrecision;
std::tie(inputPrecision, inputShapes, targetDevice) = this->GetParam();
std::tie(inputPrecision, outPrc, inputShapes, targetDevice) = this->GetParam();
auto inType = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(inputPrecision);
auto outType = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(outPrc);
auto param = ngraph::builder::makeParams(inType, {inputShapes});
auto paramOuts = ngraph::helpers::convert2OutputVector(ngraph::helpers::castOps2Nodes<ngraph::opset3::Parameter>(param));
auto shapeOf = std::make_shared<ngraph::opset3::ShapeOf>(paramOuts[0], inType);
auto shapeOf = std::make_shared<ngraph::opset3::ShapeOf>(paramOuts[0], outType);
ngraph::ResultVector results{std::make_shared<ngraph::opset3::Result>(shapeOf)};
function = std::make_shared<ngraph::Function>(results, param, "shapeOf");
}

View File

@ -6,7 +6,7 @@
namespace SubgraphTestsDefinitions {
std::string ReluShapeOfSubgraphTest::getTestCaseName(const testing::TestParamInfo<LayerTestsDefinitions::shapeOfParams>& obj) {
std::string ReluShapeOfSubgraphTest::getTestCaseName(const testing::TestParamInfo<LayerTestsDefinitions::shapeOfParamsCommon>& obj) {
InferenceEngine::SizeVector inputShapes;
InferenceEngine::Precision inputPrecision;
std::string targetDevice;