[ MO ] KSO ON by default (#1730)
[platform/upstream/dldt.git] / ngraph / core / include / ngraph / op / passthrough.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 <string>
20 #include <tuple>
21 #include <vector>
22
23 #include "ngraph/op/op.hpp"
24
25 namespace ngraph
26 {
27     namespace op
28     {
29         namespace v0
30         {
31             /// An op directly representing backend-specific code.
32             ///
33             /// N.B. Not all backends support all operation languages; a
34             /// given backend might only support a given passthrough
35             /// operation language in certain modes.
36             class Passthrough;
37         }
38         using v0::Passthrough;
39     }
40 }
41
42 class NGRAPH_API ngraph::op::v0::Passthrough final : public Op
43 {
44 public:
45     static constexpr NodeTypeInfo type_info{"Passthrough", 0};
46     const NodeTypeInfo& get_type_info() const override { return type_info; }
47     Passthrough() = default;
48
49     Passthrough(const std::string& logical_type, // aka "What this operation is doing"
50                 const std::string& language,     // The language the implementation is written in
51                 const std::string& function,     // The operation implementation
52                 const OutputVector& args,
53                 std::vector<std::tuple<element::Type, PartialShape>> outputs);
54
55     void validate_and_infer_types() final;
56
57     std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const final;
58
59     const std::string& logical_type() const { return m_logical_type; }
60     const std::string& language() const { return m_language; }
61     const std::string& function() const { return m_function; }
62     const std::vector<std::tuple<element::Type, PartialShape>>& output_shapes() const
63     {
64         return m_output_shapes;
65     }
66
67 private:
68     std::string m_logical_type;
69     std::string m_language;
70     std::string m_function;
71     std::vector<std::tuple<element::Type, PartialShape>> m_output_shapes;
72 };