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

remove temporary ReshapeLayerTestRevise #6371

Merged
merged 1 commit into from
Jun 29, 2021
Merged
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 @@ -37,29 +37,4 @@ class ReshapeLayerTest : public testing::WithParamInterface<reshapeParams>,
void SetUp() override;
};


//TODO: Drop this Revise impl when all pluging will switch back to ReshapeLayerTest
typedef std::tuple<bool, // SpecialZero
InferenceEngine::Precision, // Network precision
InferenceEngine::Precision, // Input precision
InferenceEngine::Precision, // Output precision
InferenceEngine::Layout, // Input layout
InferenceEngine::Layout, // Output layout
std::vector<size_t>, // Input shapes
std::vector<int64_t>, // OutForm Shapes
std::string, // Device name
std::map<std::string, std::string> // Config
>
reshapeParamsRevise;

class ReshapeLayerTestRevise
: public testing::WithParamInterface<reshapeParamsRevise>,
virtual public LayerTestsUtils::LayerTestsCommon {
public:
static std::string getTestCaseName(
testing::TestParamInfo<reshapeParamsRevise> obj);

protected:
void SetUp() override;
};
} // namespace LayerTestsDefinitions
Original file line number Diff line number Diff line change
Expand Up @@ -47,46 +47,4 @@ void ReshapeLayerTest::SetUp() {
function = std::make_shared<ngraph::Function>(results, paramsIn, "Reshape");
}

std::string ReshapeLayerTestRevise::getTestCaseName(testing::TestParamInfo<reshapeParamsRevise> obj) {
InferenceEngine::Precision netPrecision;
InferenceEngine::Precision inPrc, outPrc;
InferenceEngine::Layout inLayout, outLayout;
InferenceEngine::SizeVector inputShapes;
std::vector<int64_t> outFormShapes;
std::string targetDevice;
std::map<std::string, std::string> config;
bool specialZero;
std::tie(specialZero, netPrecision, inPrc, outPrc, inLayout, outLayout, inputShapes, outFormShapes, targetDevice, config) = obj.param;
std::ostringstream result;
result << "IS=" << CommonTestUtils::vec2str(inputShapes) << "_";
result << "OS=" << CommonTestUtils::vec2str(outFormShapes) << "_";
result << "specialZero=" << specialZero << "_";
result << "netPRC=" << netPrecision.name() << "_";
result << "inPRC=" << inPrc.name() << "_";
result << "outPRC=" << outPrc.name() << "_";
result << "inL=" << inLayout << "_";
result << "outL=" << outLayout << "_";
result << "trgDev=" << targetDevice;
return result.str();
}

void ReshapeLayerTestRevise::SetUp() {
InferenceEngine::SizeVector inputShapes;
std::vector<int64_t> outFormShapes;
bool specialZero;
InferenceEngine::Precision netPrecision;
std::tie(specialZero, netPrecision, inPrc, outPrc, inLayout, outLayout, inputShapes, outFormShapes, targetDevice, configuration) =
this->GetParam();
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
auto paramsIn = ngraph::builder::makeParams(ngPrc, {inputShapes});
auto paramIn = ngraph::helpers::convert2OutputVector(
ngraph::helpers::castOps2Nodes<ngraph::op::Parameter>(paramsIn));
auto constNode = std::make_shared<ngraph::opset1::Constant>(
ngraph::element::Type_t::i64, ngraph::Shape{outFormShapes.size()}, outFormShapes);
auto reshape = std::dynamic_pointer_cast<ngraph::opset1::Reshape>(
std::make_shared<ngraph::opset1::Reshape>(paramIn[0], constNode, specialZero));
ngraph::ResultVector results{std::make_shared<ngraph::opset1::Result>(reshape)};
function = std::make_shared<ngraph::Function>(results, paramsIn, "Reshape");
}

} // namespace LayerTestsDefinitions