20#include "GraphBuilder.h"
27#include <schema_generated.h>
39 assert(context !=
nullptr);
52 assert(opinputs.size() == 1);
53 assert(opoutputs.size() == 1);
55 auto ifm_idx = opinputs.at(0);
56 auto ofm_idx = opoutputs.at(0);
64 ifm_obj->
bag(ifm_bag);
70 ofm_obj->
bag(ofm_bag);
77 auto coco_relu =
m->entity()->op()->create<
coco::ReLU>();
80 coco_relu->
arg(coco_load);
OpBuilder op_builder(coco::Module *m)
InstrBuilder instr_builder(coco::Module *m)
coco::Eval * eval(coco::Object *out, coco::Op *op) const
Create "Eval" instruction with a given "Object" and "Op".
OpBuilder & load(coco::Object *obj)
Create "Load" op and push it onto the internal stack.
coco::Op * pop(void)
Pop op from the internal stack.
A collection of (abstracted) elements of the same type.
A unit of (grouped) instructions.
void append(Child *child)
static std::unique_ptr< BHWC > create(const nncc::core::ADT::feature::Shape &shape)
FeatureMap values (used in CNN)
const FeatureLayout * layout(void) const
Top-level element of coco IR which represents a neural network.
coco::Bag * bag(void) const
Apply ReLU over elements.
Op * arg(uint32_t n) const final
Return N-th argument.
Class to store context to build IR from tflite.
void build(const tflite::Operator *op, GraphBuilderContext *) const override
Pre-creates coco:Bags for each operands(tensors)
coco::Bag * bag(int32_t tensor_id)
Extracts and holds operand(tensor) information such as name, shape, and type.
const tensor::Shape & shape(uint32_t tensor_id)
nncc::core::ADT::feature::Shape as_feature_shape(const nncc::core::ADT::tensor::Shape &)
std::vector< int32_t > IndexVector
IndexVector as_index_vector(const flatbuffers::Vector< int32_t > *array)
Converts flatbuffers::Vector to IndexVector.