depth_to_space_fusion.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include <vector>
8 #include <memory>
9 
10 #include <transformations_visibility.hpp>
11 
12 #include <ngraph/pass/graph_rewrite.hpp>
13 
14 namespace ngraph {
15 namespace pass {
16 
17  class TRANSFORMATIONS_API DepthToSpaceFusion;
18 
19 } // namespace pass
20 } // namespace ngraph
21 
22 /**
23  * @ingroup ie_transformation_common_api
24  * @brief DepthToSpaceFusion transformation detects Reshape-Transpose-Reshape pattern
25  * and tries to fuse it into a single DepthToSpace layer.
26  *
27  * DepthToSpaceFusion transformation is optional and disabled by default.
28  * The transformation can be enabled with callback using setCallback method.
29  * See the example below.
30  *
31  * Callback example:
32  *
33  * // This callback enables DepthToSpaceFusion transformation
34  * auto callback = [](const std::shared_ptr<const ngraph::Node> & node) -> bool {
35  * return std::dynamic_pointer_cast<const ngraph::opset3::DepthToSpace>(node) != nullptr;
36  * };
37  *
38  * auto p = ngraph::pass::DepthToSpaceFusion();
39  * p.setCallback(callback);
40  * p.run_on_function(f);
41  *
42  */
43 
44 class ngraph::pass::DepthToSpaceFusion: public ngraph::pass::MatcherPass {
45 public:
46  NGRAPH_RTTI_DECLARATION;
48 };
DepthToSpaceFusion transformation detects Reshape-Transpose-Reshape pattern and tries to fuse it into...
Definition: depth_to_space_fusion.hpp:44
ngraph namespace
Definition: add_fake_quantize_fusion.hpp:14