13
13
namespace LayerTestsDefinitions {
14
14
15
15
std::string LrnLayerTest::getTestCaseName (testing::TestParamInfo<lrnLayerTestParamsSet> obj) {
16
- double alpha;
17
- size_t beta, bias, size;
16
+ double alpha, beta, bias;
17
+ size_t size;
18
+ std::vector<size_t > axes;
18
19
InferenceEngine::Precision netPrecision;
19
20
std::vector<size_t > inputShapes;
20
21
std::string targetDevice;
21
- std::tie (alpha, beta, bias, size, netPrecision, inputShapes, targetDevice) = obj.param ;
22
+ std::tie (alpha, beta, bias, size, axes, netPrecision, inputShapes, targetDevice) = obj.param ;
22
23
23
24
std::ostringstream result;
24
25
const char separator = ' _' ;
@@ -27,6 +28,7 @@ std::string LrnLayerTest::getTestCaseName(testing::TestParamInfo<lrnLayerTestPar
27
28
result << " Beta=" << beta << separator;
28
29
result << " Bias=" << bias << separator;
29
30
result << " Size=" << size << separator;
31
+ result << " Axes=" << CommonTestUtils::vec2str (axes) << separator;
30
32
result << " netPRC=" << netPrecision.name () << separator;
31
33
result << " targetDevice=" << targetDevice;
32
34
@@ -36,16 +38,19 @@ std::string LrnLayerTest::getTestCaseName(testing::TestParamInfo<lrnLayerTestPar
36
38
void LrnLayerTest::SetUp () {
37
39
std::vector<size_t > inputShapes;
38
40
auto netPrecision = InferenceEngine::Precision::UNSPECIFIED;
39
- size_t alpha, beta, bias, size;
40
- std::tie (alpha, beta, bias, size, netPrecision, inputShapes, targetDevice) = GetParam ();
41
+ double alpha, beta, bias;
42
+ size_t size;
43
+ std::vector<size_t > axes;
44
+ std::tie (alpha, beta, bias, size, axes, netPrecision, inputShapes, targetDevice) = GetParam ();
41
45
42
46
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc (netPrecision);
43
47
auto params = ngraph::builder::makeParams (ngPrc, {inputShapes});
44
48
auto paramIn =
45
49
ngraph::helpers::convert2OutputVector (ngraph::helpers::castOps2Nodes<ngraph::op::Parameter>(params));
46
50
47
- auto lrn = std::make_shared<ngraph::opset1::LRN>(paramIn[0 ], alpha, beta, bias, size);
48
- ngraph::ResultVector results {std::make_shared<ngraph::opset1::Result>(lrn)};
51
+ auto axes_node = std::make_shared<ngraph::op::Constant>(ngraph::element::i64 , ngraph::Shape{axes.size ()}, axes.data ());
52
+ auto lrn = std::make_shared<ngraph::opset3::LRN>(paramIn[0 ], axes_node, alpha, beta, bias, size);
53
+ ngraph::ResultVector results {std::make_shared<ngraph::opset3::Result>(lrn)};
49
54
function = std::make_shared<ngraph::Function>(results, params, " lrn" );
50
55
}
51
56
0 commit comments