validate.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include "ngraph/pass/pass.hpp"
8 
9 namespace ngraph
10 {
11  namespace pass
12  {
13  /// \brief The Validate pass performs sanity checks on attributes and inputs, and
14  /// computes output shapes and element types for all computation nodes in a given
15  /// computation graph.
16  ///
17  /// \details The verification and inference is done via invoking each node's specific
18  /// implementation of \link ngraph::Node::validate_and_infer_types() \endlink function.
19  ///
20  /// By default, the \ref ngraph::pass::Manager runs this pass after executing every
21  /// optimization pass. This is to ensure that any update to the graph by an optimization
22  /// pass does not break the shape and data type requirement on a computation node.
23  /// This default validation run can be changed via calling the
24  /// \link ngraph::pass::Manager::set_per_pass_validation(bool) \endlink function.
25  class NGRAPH_API Validate : public FunctionPass
26  {
27  public:
28  NGRAPH_RTTI_DECLARATION;
29 
30  Validate()
31  : FunctionPass()
32  {
33  }
34  bool run_on_function(std::shared_ptr<ngraph::Function> f) override;
35  };
36  } // namespace pass
37 } // namespace ngraph
Definition: pass.hpp:94
The Validate pass performs sanity checks on attributes and inputs, and computes output shapes and ele...
Definition: validate.hpp:26
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:16