Class ov::pass::DepthToSpaceFusion#

class DepthToSpaceFusion : public ov::pass::MatcherPass#

DepthToSpaceFusion transformation detects Reshape-Transpose-Reshape pattern and tries to fuse it into a single DepthToSpace layer.

DepthToSpaceFusion transformation is optional and disabled by default. The transformation can be enabled with callback using setCallback method. See the example below.

Callback example:

// This callback enables DepthToSpaceFusion transformation
auto callback = [](const std::shared_ptr<const ov::Node> & node) -> bool {
    return std::dynamic_pointer_cast<const ov::opset3::DepthToSpace>(node) != nullptr;

auto p = ov::pass::DepthToSpaceFusion();