any_output.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  /// Matches any output of a node
17  class NGRAPH_API AnyOutput : public Pattern
18  {
19  public:
20  static constexpr NodeTypeInfo type_info{"patternAnyOutput", 0};
21  const NodeTypeInfo& get_type_info() const override;
22  /// \brief creates an AnyOutput node matching any output of a node
23  /// \param node The node to match
24  AnyOutput(const std::shared_ptr<Node>& pattern)
25  : Pattern({pattern->output(0)})
26  {
27  }
28 
29  bool match_value(pattern::Matcher* matcher,
30  const Output<Node>& pattern_value,
31  const Output<Node>& graph_value) override;
32  };
33  } // namespace op
34  } // namespace pattern
35 } // namespace ngraph
A handle for one of a node's outputs.
Definition: node_output.hpp:33
Definition: matcher.hpp:63
Matches any output of a node.
Definition: any_output.hpp:18
const NodeTypeInfo & get_type_info() const override
AnyOutput(const std::shared_ptr< Node > &pattern)
creates an AnyOutput node matching any output of a node
Definition: any_output.hpp:24
Definition: pattern.hpp:73
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16
Definition: type.hpp:27