This commit adds layout as a member of SubGraph into KernelGenerators.
Signed-off-by: jiseob.jang <jiseob.jang@samsung.com>
void KernelGenerator::visit(const model::Subgraph &subgraph)
{
+ _current_subg_layout = subgraph.getLayout();
for (const auto &e : subgraph.operations())
{
const auto &node = *(e.node);
private:
const neurun::model::Operands &_ctx;
std::shared_ptr<TensorBuilder> _tensor_builder;
+ model::Layout _current_subg_layout;
};
} // namespace acl_cl
void KernelGenerator::visit(const model::Subgraph &subgraph)
{
+ _current_subg_layout = subgraph.getLayout();
for (const auto &e : subgraph.operations())
{
const auto &node = *(e.node);
private:
const neurun::model::Operands &_ctx;
std::shared_ptr<TensorBuilder> _tensor_builder;
+ model::Layout _current_subg_layout;
};
} // namespace acl_neon
// DO NOTHING
}
+void KernelGenerator::visit(const model::Subgraph &subgraph)
+{
+ _current_subg_layout = subgraph.getLayout();
+ for (const auto &e : subgraph.operations())
+ {
+ const auto &node = *(e.node);
+ _tensor_builder->preVisit(node);
+ node.accept(*this);
+ _tensor_builder->postVisit(node);
+ }
+}
+
void KernelGenerator::visit(const model::operation::Conv2DNode &node)
{
using model::operation::Conv2DNode;
KernelGenerator(const neurun::model::Operands &ctx,
const std::shared_ptr<TensorBuilder> &tensor_builder);
+ void visit(const model::Subgraph &) override;
void visit(const model::operation::Conv2DNode &) override;
void visit(const model::operation::DepthwiseConv2DNode &) override;
void visit(const model::operation::MaxPool2DNode &) override;
private:
const neurun::model::Operands &_ctx;
std::shared_ptr<TensorBuilder> _tensor_builder;
+ model::Layout _current_subg_layout;
};
} // namespace cpu