or.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include "ngraph/node.hpp"
8 #include "ngraph/pattern/op/pattern.hpp"
9 
10 namespace ngraph
11 {
12  namespace pattern
13  {
14  namespace op
15  {
16  /// A submatch on the graph value is performed on each input to the Or; the match
17  /// succeeds on the first match. Otherwise the match fails.
18  class NGRAPH_API Or : public Pattern
19  {
20  public:
21  static constexpr NodeTypeInfo type_info{"patternOr", 0};
22  const NodeTypeInfo& get_type_info() const override;
23  /// \brief creates an Or node matching one of several sub-patterns in order. Does
24  /// not add node to match list.
25  /// \param patterns The patterns to try for matching
26  Or(const OutputVector& patterns)
27  : Pattern(patterns)
28  {
29  }
30 
31  bool match_value(pattern::Matcher* matcher,
32  const Output<Node>& pattern_value,
33  const Output<Node>& graph_value) override;
34  };
35  } // namespace op
36  } // namespace pattern
37 } // namespace ngraph
A handle for one of a node's outputs.
Definition: node_output.hpp:33
Definition: matcher.hpp:63
Definition: or.hpp:19
const NodeTypeInfo & get_type_info() const override
Or(const OutputVector &patterns)
creates an Or node matching one of several sub-patterns in order. Does not add node to match list.
Definition: or.hpp:26
Definition: pattern.hpp:73
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16
Definition: type.hpp:27