Skip to content

Commit

Permalink
Eliminate makeParameter and makeDynamicParameter usage
Browse files Browse the repository at this point in the history
  • Loading branch information
olpipi committed Aug 9, 2023
1 parent c4e1339 commit 0193980
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ class ConvolutionBackpropDataExtendedLayerTest
std::tie(kernel, stride, padBegin, padEnd, dilation, convOutChannels, padType, outputPad) =
convBackpropDataParams;
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
auto params = ngraph::builder::makeParams(ngPrc, {inputShape});
ov::ParameterVector params {std::make_shared<ov::op::v0::Parameter>(ngPrc, ov::Shape(inputShape)))};

auto outputShapeNode =
ngraph::builder::makeConstant(ov::element::Type_t::i64, {outputShapeData.size()}, outputShapeData);
auto paramOuts =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ class ConvolutionBackpropDataAddExtendedLayerTest
std::tie(kernel, stride, padBegin, padEnd, dilation, convOutChannels, padType, outputPad) =
convBackpropDataParams;
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
auto params = ngraph::builder::makeParams(ngPrc, {inputShape});
ov::ParameterVector params {std::make_shared<ov::op::v0::Parameter>(ngPrc, ov::Shape(inputShape)))};

auto outputShapeNode =
ngraph::builder::makeConstant(ov::element::Type_t::i64, {outputShapeData.size()}, outputShapeData);
auto paramOuts =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ class BasicConvolutionBiasAddActivationLayerTest
}

auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
auto params = ngraph::builder::makeParams(ngPrc, {inputShape});
ov::ParameterVector params {std::make_shared<ov::op::v0::Parameter>(ngPrc, ov::Shape(inputShape)))};

auto paramOuts =
ngraph::helpers::convert2OutputVector(ngraph::helpers::castOps2Nodes<ov::op::v0::Parameter>(params));
std::vector<float> filter_weights;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ void CudaEltwiseLayerTest::SetUp() {

init_input_shapes(shapes);

auto parameters = ngraph::builder::makeDynamicParams(netType, {inputDynamicShapes.front()});
ov::ParameterVector parameters {std::make_shared<ov::op::v0::Parameter>(netType, inputDynamicShapes.front)};

ov::PartialShape shape_input_secondary;
switch (opType) {
Expand All @@ -229,8 +229,9 @@ void CudaEltwiseLayerTest::SetUp() {

std::shared_ptr<ngraph::Node> secondaryInput;
if (secondaryInputType == ngraph::helpers::InputLayerType::PARAMETER) {
secondaryInput = ngraph::builder::makeDynamicParams(netType, {shape_input_secondary}).front();
parameters.push_back(std::dynamic_pointer_cast<ngraph::opset3::Parameter>(secondaryInput));
auto input = std::make_shared<ov::op::v0::Parameter>(netType, shape_input_secondary);
secondaryInput = input;
parameters.push_back(input);
} else {
constexpr bool is_random = true;
ov::Shape shape = inputDynamicShapes.back().get_max_shape();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class FullyConnectedLayerTest : public testing::WithParamInterface<FullyConnecte
configuration.insert(additionalConfig.begin(), additionalConfig.end());

auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
auto params = ngraph::builder::makeParams(ngPrc, {shapeRelatedParams.input1.first});
ov::ParameterVector params {std::make_shared<ov::op::v0::Parameter>(ngPrc, ov::Shape{shapeRelatedParams.input1.first})};

std::shared_ptr<ov::Node> secondaryInput;
if (secondaryInputType == ngraph::helpers::InputLayerType::PARAMETER) {
Expand Down Expand Up @@ -190,8 +190,9 @@ class FullyConnectedLayer2MatMulTest : public testing::WithParamInterface<FullyC
configuration.insert(additionalConfig.begin(), additionalConfig.end());

auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
auto params = ngraph::builder::makeParams(
ngPrc, {shapeRelatedParams.matmul1_input1.first, shapeRelatedParams.matmul2_input1.first});
ov::ParameterVector params;
params.push_back(std::make_shared<ov::op::v0::Parameter>(ngPrc, ov::Shape(shapeRelatedParams.matmul1_input1.first)));
params.push_back(std::make_shared<ov::op::v0::Parameter>(ngPrc, ov::Shape(shapeRelatedParams.matmul2_input1.first)));

std::shared_ptr<ov::Node> matmul0SecondaryInput;
if (secondaryInputType == ngraph::helpers::InputLayerType::PARAMETER) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ class LPCNetCUDNNGRUSequenceTest : public UnsymmetricalComparer<GRUSequenceTest>
};
m_max_seq_len_ = seq_lengths;
auto ngPrc = FuncTestUtils::PrecisionUtils::convertIE2nGraphPrc(netPrecision);
auto params = ngraph::builder::makeParams(ngPrc, {inputShapes[0], inputShapes[1]});
ov::ParameterVector params;
params.push_back(std::make_shared<ov::op::v0::Parameter>(ngPrc, ov::Shape(inputShapes[0])));
params.push_back(std::make_shared<ov::op::v0::Parameter>(ngPrc, ov::Shape(inputShapes[1])));

ASSERT_EQ(InputLayerType::CONSTANT, WRBType);
std::vector<ov::Shape> WRB = {inputShapes[3], inputShapes[4], inputShapes[5], inputShapes[2]};
Expand Down
4 changes: 2 additions & 2 deletions modules/nvidia_plugin/tests/unit/test_networks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inline std::shared_ptr<ngraph::Function> CreateMatMulTestNetwork() {
std::map<std::string, std::string> additionalConfig;

auto ngPrc = InferenceEngine::details::convertPrecision(netPrecision);
auto params = ngraph::builder::makeParams(ngPrc, {{3, 2, 10, 10}});
ov::ParameterVector params {std::make_shared<ov::op::v0::Parameter>(ngPrc, ov::Shape{3, 2, 10, 10})};

auto secondaryInput = std::make_shared<ov::op::v0::Constant>(ngPrc, ov::Shape{3, 2, 10, 20});
auto paramOuts =
Expand Down Expand Up @@ -66,7 +66,7 @@ inline std::shared_ptr<ngraph::Function> CreateSuperOperationTestNetwork() {
std::map<std::string, std::string> additionalConfig;

auto ngPrc = InferenceEngine::details::convertPrecision(netPrecision);
auto params = ngraph::builder::makeParams(ngPrc, {{3, 2, 10, 10}});
ov::ParameterVector params {std::make_shared<ov::op::v0::Parameter>(ngPrc, ov::Shape{3, 2, 10, 10})};

auto secondaryInput = std::make_shared<ov::op::v0::Constant>(ngPrc, ov::Shape{3, 2, 10, 20});
auto paramOuts =
Expand Down

0 comments on commit 0193980

Please sign in to comment.