[LPT] GroupConvolution plugin tests: test class corrected to restore behavior in arm plugin instances (#16883)
* [LPT] GroupConvolution plugin tests: restored test params default values * return FQOnData shape automatic generation
This commit is contained in:
1 parent
1ba87971d1
commit
9c6d287a58
3 files changed
+29
-16
No files matched your search
+16
@@ -15,6 +15,22 @@ namespace LayerTestsDefinitions {
|
||||
|
||||
class GroupConvolutionTransformationParam {
|
||||
public:
|
||||
GroupConvolutionTransformationParam() = default;
|
||||
GroupConvolutionTransformationParam(const size_t group,
|
||||
const int groupCalculationDimention,
|
||||
const ngraph::builder::subgraph::FakeQuantizeOnData& fakeQuantizeOnData,
|
||||
const ngraph::builder::subgraph::FakeQuantizeOnWeights& fakeQuantizeOnWeights,
|
||||
const bool addReshape = true,
|
||||
const std::string& layerName = "",
|
||||
const std::string& expectedKernelType = "")
|
||||
: group(group),
|
||||
groupCalculationDimention(groupCalculationDimention),
|
||||
fakeQuantizeOnData(fakeQuantizeOnData),
|
||||
fakeQuantizeOnWeights(fakeQuantizeOnWeights),
|
||||
addReshape(addReshape),
|
||||
layerName(layerName),
|
||||
expectedKernelType(expectedKernelType) {}
|
||||
|
||||
size_t group;
|
||||
int groupCalculationDimention;
|
||||
ngraph::builder::subgraph::FakeQuantizeOnData fakeQuantizeOnData;
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ std::string GroupConvolutionTransformation::getTestCaseName(const testing::TestP
|
||||
param.group << "_" <<
|
||||
param.groupCalculationDimention << "_" <<
|
||||
param.fakeQuantizeOnData << "_" <<
|
||||
(param.addReshape ? "reshape_on_weights_" : "") <<
|
||||
(param.addReshape ? "reshape_on_weights_" : "wo_reshape_") <<
|
||||
(addPrecisionPreserved ? "max_pool_" : "") <<
|
||||
param.fakeQuantizeOnWeights;
|
||||
return result.str();
|
||||
|
||||
@@ -181,34 +181,31 @@ std::shared_ptr<ngraph::Function> GroupConvolutionFunction::getOriginal(
|
||||
|
||||
std::shared_ptr<ngraph::Node> parent = input;
|
||||
if (!fakeQuantizeOnData.empty()) {
|
||||
auto getConstShape = [&](const size_t elemsCount) {
|
||||
Shape constantShape;
|
||||
if (ov::shape_size(fakeQuantizeOnData.constantShape) != 1) {
|
||||
constantShape = fakeQuantizeOnData.constantShape;
|
||||
} else {
|
||||
constantShape = Shape(rankLength, 1);
|
||||
constantShape[1] = elemsCount;
|
||||
}
|
||||
return constantShape;
|
||||
};
|
||||
|
||||
parent = std::make_shared<ngraph::opset1::FakeQuantize>(
|
||||
input,
|
||||
std::make_shared<ngraph::opset1::Constant>(
|
||||
precision,
|
||||
getConstShape(fakeQuantizeOnData.inputLowValues.size()),
|
||||
rankLength == 3 ?
|
||||
Shape{ 1, fakeQuantizeOnData.inputLowValues.size(), 1 } :
|
||||
Shape{ 1, fakeQuantizeOnData.inputLowValues.size(), 1, 1 },
|
||||
fakeQuantizeOnData.inputLowValues),
|
||||
std::make_shared<ngraph::opset1::Constant>(
|
||||
precision,
|
||||
getConstShape(fakeQuantizeOnData.inputHighValues.size()),
|
||||
rankLength == 3 ?
|
||||
Shape{ 1, fakeQuantizeOnData.inputHighValues.size(), 1 } :
|
||||
Shape{ 1, fakeQuantizeOnData.inputHighValues.size(), 1, 1 },
|
||||
fakeQuantizeOnData.inputHighValues),
|
||||
std::make_shared<ngraph::opset1::Constant>(
|
||||
precision,
|
||||
getConstShape(fakeQuantizeOnData.outputLowValues.size()),
|
||||
rankLength == 3 ?
|
||||
Shape{ 1, fakeQuantizeOnData.outputLowValues.size(), 1 } :
|
||||
Shape{ 1, fakeQuantizeOnData.outputLowValues.size(), 1, 1 },
|
||||
fakeQuantizeOnData.outputLowValues),
|
||||
std::make_shared<ngraph::opset1::Constant>(
|
||||
precision,
|
||||
getConstShape(fakeQuantizeOnData.outputHighValues.size()),
|
||||
rankLength == 3 ?
|
||||
Shape{ 1, fakeQuantizeOnData.outputHighValues.size(), 1 } :
|
||||
Shape{ 1, fakeQuantizeOnData.outputHighValues.size(), 1, 1 },
|
||||
fakeQuantizeOnData.outputHighValues),
|
||||
fakeQuantizeOnData.quantizationLevel);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user