#include "Frontend.h"
#include "IRBuilder.h"
+#include <nncc/core/ADT/tensor/LexicalLayout.h>
#include <nncc/core/ADT/tensor/Shape.h>
#include <map>
};
/**
+ * @brief Set module input operands and its information
+ */
+void set_module_inputs(coco::Module *m, TensorContext &ctx, TensorBags &bags,
+ const IndexVector &inputs)
+{
+ for (uint32_t n = 0; n < inputs.size(); ++n)
+ {
+ auto const tensor_id = inputs.at(n);
+
+ auto const tensor_name = ctx.name(tensor_id);
+ auto const tensor_shape = ctx.shape(tensor_id);
+ auto const tensor_bag = bags.bag(tensor_id);
+
+ auto input = m->entity()->input()->create(tensor_shape);
+
+ input->name(tensor_name);
+ input->bag(tensor_bag);
+ input->reorder<tensor::LexicalLayout>();
+
+ m->input()->insert(input);
+ }
+}
+
+/**
+ * @brief Set module output operands and its information
+ */
+void set_module_outputs(coco::Module *m, TensorContext &ctx, TensorBags &bags,
+ const IndexVector &outputs)
+{
+ for (uint32_t n = 0; n < outputs.size(); ++n)
+ {
+ auto const tensor_id = outputs.at(n);
+
+ auto const tensor_name = ctx.name(tensor_id);
+ auto const tensor_shape = ctx.shape(tensor_id);
+ auto const tensor_bag = bags.bag(tensor_id);
+
+ auto output = m->entity()->output()->create(tensor_shape);
+
+ output->name(tensor_name);
+ output->bag(tensor_bag);
+ output->reorder<tensor::LexicalLayout>();
+
+ m->output()->insert(output);
+ }
+}
+
+/**
* @brief Class to store context to build IR from tflite
*/
class GraphBuilderContext