Auto-generate NodeVisitor headers with macro.
Resolve #3664
Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
virtual std::shared_ptr<ITensorBuilder> tensor_builder() override { return _tensor_builder; }
- virtual void visit(const graph::operation::Conv2DNode &node) override;
- virtual void visit(const graph::operation::MaxPool2DNode &node) override;
- virtual void visit(const graph::operation::AvgPool2DNode &node) override;
- virtual void visit(const graph::operation::ConcatNode &node) override;
- virtual void visit(const graph::operation::FullyConnectedNode &node) override;
- virtual void visit(const graph::operation::ReshapeNode &node) override;
- virtual void visit(const graph::operation::SoftmaxNode &node) override;
- virtual void visit(const graph::operation::PermuteNode &node) override;
- virtual void visit(const graph::operation::AddNode &node) override;
+#define OP(InternalName, IsNnApi, NnApiName) \
+ virtual void visit(const graph::operation::InternalName &) override;
+#include "graph/operation/Op.lst"
+#undef OP
private:
const neurun::graph::operand::Set &_ctx;
virtual std::shared_ptr<ITensorBuilder> tensor_builder() override { return _tensor_builder; }
- virtual void visit(const graph::operation::Conv2DNode &node) override;
- virtual void visit(const graph::operation::MaxPool2DNode &node) override;
- virtual void visit(const graph::operation::AvgPool2DNode &node) override;
- virtual void visit(const graph::operation::ConcatNode &node) override;
- virtual void visit(const graph::operation::FullyConnectedNode &node) override;
- virtual void visit(const graph::operation::ReshapeNode &node) override;
- virtual void visit(const graph::operation::SoftmaxNode &node) override;
- virtual void visit(const graph::operation::PermuteNode &node) override;
- virtual void visit(const graph::operation::AddNode &node) override;
+#define OP(InternalName, IsNnApi, NnApiName) \
+ virtual void visit(const graph::operation::InternalName &) override;
+#include "graph/operation/Op.lst"
+#undef OP
private:
const neurun::graph::operand::Set &_ctx;
virtual std::shared_ptr<ITensorBuilder> tensor_builder() = 0;
protected:
- virtual void visit(const graph::operation::Conv2DNode &) override {}
- virtual void visit(const graph::operation::MaxPool2DNode &) override {}
- virtual void visit(const graph::operation::AvgPool2DNode &) override {}
- virtual void visit(const graph::operation::ConcatNode &) override {}
- virtual void visit(const graph::operation::FullyConnectedNode &) override {}
- virtual void visit(const graph::operation::ReshapeNode &) override {}
- virtual void visit(const graph::operation::SoftmaxNode &) override {}
- virtual void visit(const graph::operation::PermuteNode &) override {}
- virtual void visit(const graph::operation::AddNode &) override {}
+#define OP(InternalName, IsNnApi, NnApiName) \
+ virtual void visit(const graph::operation::InternalName &) override {}
+#include "graph/operation/Op.lst"
+#undef OP
protected:
void returnStage(const Stage &stage) { _return = stage; }
OperationValidator(const neurun::graph::operand::Set &ctx) : _ctx{ctx} {}
public:
- virtual void visit(const graph::operation::Conv2DNode &) override;
- virtual void visit(const graph::operation::MaxPool2DNode &) override;
- virtual void visit(const graph::operation::AvgPool2DNode &) override;
- virtual void visit(const graph::operation::ConcatNode &) override;
- virtual void visit(const graph::operation::ReshapeNode &) override;
- virtual void visit(const graph::operation::FullyConnectedNode &) override;
- virtual void visit(const graph::operation::SoftmaxNode &) override;
- virtual void visit(const graph::operation::PermuteNode &) override;
- virtual void visit(const graph::operation::AddNode &) override;
+#define OP(InternalName, IsNnApi, NnApiName) \
+ virtual void visit(const graph::operation::InternalName &) override;
+#include "graph/operation/Op.lst"
+#undef OP
private:
const neurun::graph::operand::Set &_ctx;
SubTensorAnalyzer(neurun::graph::operand::Set &ctx) : _ctx{ctx} {}
public:
- virtual void visit(const graph::operation::Conv2DNode &) override;
- virtual void visit(const graph::operation::MaxPool2DNode &) override;
- virtual void visit(const graph::operation::AvgPool2DNode &) override;
- virtual void visit(const graph::operation::ConcatNode &) override;
- virtual void visit(const graph::operation::ReshapeNode &) override;
- virtual void visit(const graph::operation::FullyConnectedNode &) override;
- virtual void visit(const graph::operation::SoftmaxNode &) override;
- virtual void visit(const graph::operation::PermuteNode &) override;
- virtual void visit(const graph::operation::AddNode &) override;
+#define OP(InternalName, IsNnApi, NnApiName) \
+ virtual void visit(const graph::operation::InternalName &) override;
+#include "graph/operation/Op.lst"
+#undef OP
private:
neurun::graph::operand::Set &_ctx;
{
virtual ~NodeVisitor() = default;
- virtual void visit(const Conv2DNode &) {}
- virtual void visit(const MaxPool2DNode &) {}
- virtual void visit(const AvgPool2DNode &) {}
- virtual void visit(const ConcatNode &) {}
- virtual void visit(const ReshapeNode &) {}
- virtual void visit(const FullyConnectedNode &) {}
- virtual void visit(const SoftmaxNode &) {}
- virtual void visit(const PermuteNode &) {}
- virtual void visit(const AddNode &) {}
+#define OP(InternalName, IsNnApi, NnApiName) \
+ virtual void visit(const InternalName &) {}
+#include "graph/operation/Op.lst"
+#undef OP
};
} // namespace operation