Closed cpetig closed 4 years ago
Current proposal: enum used_operators_e { // implementation for #7 OP_CONV_2D, OP_MAXPOOL, OP_LAST };
struct NodeInfo_t { struct TfLiteIntArray inputs, outputs; void *opdata; used_operators_e optype; }; static const NodeInfo_t prefix_nodes[5] = { { &prefix_inputs0, &prefix_outputs0, &prefix_opdata0, OP_CONV_2D }, { &prefix_inputs1, &prefix_outputs1, &prefix_opdata1, OP_MAXPOOL }, ... };
The size of the generated code can be further reduced by writing a const array containing node and tensor values and then using a for loop in init and invoke. I believe the more nice variant is to use another structure to collect the values, then fill them one node/tensor per line.