forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CPU][ARM] Support deconvolution to correctly handle multiple output …
…edges on a single output port (openvinotoolkit#24754)
- Loading branch information
Showing
2 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...intel_cpu/tests/functional/custom/subgraph_tests/src/arm/deconv_multiple_output_edges.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright (C) 2023 Intel Corporation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
#include "common_test_utils/node_builders/constant.hpp" | ||
#include "common_test_utils/node_builders/eltwise.hpp" | ||
#include "shared_test_classes/base/ov_subgraph.hpp" | ||
#include "utils/cpu_test_utils.hpp" | ||
#include "common_test_utils/node_builders/convolution_backprop_data.hpp" | ||
|
||
using namespace CPUTestUtils; | ||
|
||
namespace ov { | ||
namespace test { | ||
|
||
// Subgraph: | ||
/* | ||
┌──────────────────┐ ┌──────────────────┐ | ||
│ INPUT │ │ WEIGHTS │ | ||
└─────────┬────────┘ └─────────┬────────┘ | ||
│ ┌──────────────────┐ │ | ||
└──────┤ DECONVOLUTION ├────┘ | ||
└──┬───────────┬───┘ | ||
│ │ | ||
┌───────────────┴──┐ ┌──┴───────────────┐ | ||
│ MULTIPLY │ │ MULTIPLY │ | ||
└──────────────────┘ └──────────────────┘ | ||
Verify deconvolution node correctly handles | ||
multiple output edges on a single output port | ||
*/ | ||
|
||
class DeconvMultipleOutputEdges : virtual public SubgraphBaseStaticTest { | ||
public: | ||
void SetUp() override { | ||
auto ngPrc = ov::element::f32; | ||
const ov::Shape inShape = {2, 12, 7, 7}; | ||
const ov::Shape weiShape = {12, 6, 3, 3}; | ||
ov::ParameterVector inputParams{std::make_shared<ov::op::v0::Parameter>(ngPrc, inShape), | ||
std::make_shared<ov::op::v0::Parameter>(ngPrc, weiShape)}; | ||
|
||
auto deconv = utils::make_convolution_backprop_data(inputParams[0], | ||
inputParams[1], | ||
ov::element::f32, | ||
ov::Strides({1, 1}), | ||
ov::CoordinateDiff({0, 0}), | ||
ov::CoordinateDiff({0, 0}), | ||
ov::Strides({1, 1}), | ||
ov::op::PadType::NOTSET, | ||
false); | ||
deconv->get_rt_info() = CPUTestsBase::makeCPUInfo({nchw}, {nchw}, {}); | ||
|
||
const auto const1 = ov::test::utils::make_constant(ngPrc, std::vector<size_t>{2, 6, 9, 9}); | ||
const auto const2 = ov::test::utils::make_constant(ngPrc, std::vector<size_t>{2, 6, 9, 9}); | ||
|
||
const auto mul1 = utils::make_eltwise(deconv->output(0), const1, utils::EltwiseTypes::MULTIPLY); | ||
const auto mul2 = utils::make_eltwise(deconv->output(0), const2, utils::EltwiseTypes::MULTIPLY); | ||
|
||
NodeVector results{mul1, mul2}; | ||
function = std::make_shared<ov::Model>(results, inputParams, "DeconvMultipleOutputEdges"); | ||
targetDevice = ov::test::utils::DEVICE_CPU; | ||
} | ||
}; | ||
|
||
TEST_F(DeconvMultipleOutputEdges, smoke_DeconvMultipleOutputEdges_CPU) { | ||
run(); | ||
} | ||
|
||
} // namespace test | ||
} // namespace ov |