any_output.hpp
1 //*****************************************************************************
2 // Copyright 2017-2020 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //*****************************************************************************
16 
17 #pragma once
18 
19 #include "ngraph/node.hpp"
20 #include "ngraph/pattern/op/pattern.hpp"
21 
22 namespace ngraph
23 {
24  namespace pattern
25  {
26  namespace op
27  {
28  /// Matches any output of a node
29  class NGRAPH_API AnyOutput : public Pattern
30  {
31  public:
32  static constexpr NodeTypeInfo type_info{"patternAnyOutput", 0};
33  const NodeTypeInfo& get_type_info() const override;
34  /// \brief creates an AnyOutput node matching any output of a node
35  /// \param node The node to match
36  AnyOutput(const std::shared_ptr<Node>& pattern)
37  : Pattern({pattern->output(0)})
38  {
39  }
40 
41  bool match_value(pattern::Matcher* matcher,
42  const Output<Node>& pattern_value,
43  const Output<Node>& graph_value) override;
44  };
45  }
46  }
47 }
ngraph::pattern::op::AnyOutput::AnyOutput
AnyOutput(const std::shared_ptr< Node > &pattern)
creates an AnyOutput node matching any output of a node
Definition: any_output.hpp:36
ngraph::pattern::op::AnyOutput
Matches any output of a node.
Definition: any_output.hpp:30
ngraph::pattern::Matcher
Definition: matcher.hpp:75
ngraph::pattern::op::Pattern
Definition: pattern.hpp:79
ngraph
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28
ngraph::pattern::op::AnyOutput::get_type_info
const NodeTypeInfo & get_type_info() const override