1 //*****************************************************************************
2 // Copyright 2017-2020 Intel Corporation
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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 //*****************************************************************************
23 #include "ngraph/op/op.hpp"
31 /// An op directly representing backend-specific code.
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.
38 using v0::Passthrough;
42 class NGRAPH_API ngraph::op::v0::Passthrough final : public Op
45 static constexpr NodeTypeInfo type_info{"Passthrough", 0};
46 const NodeTypeInfo& get_type_info() const override { return type_info; }
47 Passthrough() = default;
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);
55 void validate_and_infer_types() final;
57 std::shared_ptr<Node> clone_with_new_inputs(const OutputVector& new_args) const final;
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
64 return m_output_shapes;
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;