op.hpp
1 // Copyright (C) 2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include <ngraph/ngraph.hpp>
8 
9 //! [op:header]
10 namespace TemplateExtension {
11 
12 class Operation : public ngraph::op::Op {
13 public:
14  static constexpr ngraph::NodeTypeInfo type_info{"Template", 0};
15  const ngraph::NodeTypeInfo& get_type_info() const override { return type_info; }
16 
17  Operation() = default;
18  Operation(const ngraph::Output<ngraph::Node>& arg, int64_t add);
19  void validate_and_infer_types() override;
20  std::shared_ptr<ngraph::Node> copy_with_new_args(const ngraph::NodeVector& new_args) const override;
21  bool visit_attributes(ngraph::AttributeVisitor& visitor) override;
22  int64_t getAddAttr() { return add; }
23 
24 private:
25  int64_t add;
26 };
27 //! [op:header]
28 
29 } // namespace TemplateExtension
[extension:header]
Definition: cpu_kernel.hpp:10
void validate_and_infer_types() override
[op:ctor]
Definition: op.cpp:17
std::shared_ptr< ngraph::Node > copy_with_new_args(const ngraph::NodeVector &new_args) const override
[op:validate]
Definition: op.cpp:24
bool visit_attributes(ngraph::AttributeVisitor &visitor) override
[op:copy]
Definition: op.cpp:34
Definition: op.hpp:12