// Copyright (C) 2018-2025 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // #pragma once #include "openvino/op/constant.hpp" #include "openvino/pass/pattern/op/or.hpp" #include "openvino/pass/pattern/op/predicate.hpp" namespace ov::pass::pattern { // A glue/syntax-sugar type which allows more types to be used as input to pattern operations struct OPENVINO_API PatternOp { private: std::shared_ptr op; int64_t output_idx = -1; public: operator ov::Output() const; ov::Output get_output() const; PatternOp(const Output& out); template >* = nullptr> PatternOp(const std::shared_ptr& op) : op(std::dynamic_pointer_cast(op)) {} PatternOp(const std::shared_ptr& op); PatternOp(ov::Rank rank); // Constant matching PatternOp(const char* value_notation); PatternOp(std::string value_notation); PatternOp(int v); PatternOp(float v); PatternOp(double v); PatternOp(long long v); PatternOp(std::initializer_list&& v); PatternOp(std::initializer_list&& v); PatternOp(std::initializer_list&& v); PatternOp(std::initializer_list&& v); PatternOp(std::initializer_list&& v); PatternOp(std::initializer_list&& v); }; // Syntax-sugar type for pattern operators to consume all the different ways to pass containter of inputs with use of // PatternOp struct OPENVINO_API PatternOps { private: std::vector data; public: PatternOps(); // single element template >* = nullptr> PatternOps(const T& in) : data{PatternOp(in)} {}; PatternOps(const std::shared_ptr&); PatternOps(const Output&); // multi-element PatternOps(const OutputVector&); PatternOps(std::initializer_list&&); explicit operator ov::OutputVector() const; }; } // namespace ov::pass::pattern