set(tflite_importer_sources ${CMAKE_CURRENT_SOURCE_DIR}/src/tflite_walker.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tflite_dump_visitor.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/tflite_ir_visitor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tflite_v3_importer.cpp)
file(GLOB tflite_importer_headers include/*.h)
list(APPEND tflite_importer_headers ${FB_GEN_SOURCES})
--- /dev/null
+#ifndef NNCC_TFLITE_IR_VISITOR_H
+#define NNCC_TFLITE_IR_VISITOR_H
+
+#include "flatbuffers/flatbuffers.h"
+
+#include "schema_v3.h"
+#include "tflite_visitor.h"
+
+using namespace v3_tflite;
+
+namespace nncc
+{
+namespace contrib
+{
+namespace frontend
+{
+namespace tflite
+{
+
+class IrVisitor : public Visitor
+{
+public:
+ void visit(const Model *) override;
+ void visit(const SubGraph *) override;
+ void visit(const Tensor *) override;
+ void visit(const OperatorCode *) override;
+ void visit(const Operator *) override;
+ void visit(const Buffer *) override;
+
+private:
+ const flatbuffers::Vector<flatbuffers::Offset<OperatorCode>> *opcodes = nullptr;
+ const flatbuffers::Vector<flatbuffers::Offset<Tensor>> *tensors = nullptr;
+ const flatbuffers::Vector<flatbuffers::Offset<Buffer>> *buffers = nullptr;
+};
+
+} // namespace tflite
+} // namespace frontend
+} // namespace contrib
+} // namespace nncc
+
+#endif // NNCC_TFLITE_IR_VISITOR_H
--- /dev/null
+#include <stdexcept>
+
+#include "tflite_ir_visitor.h"
+
+namespace nncc
+{
+namespace contrib
+{
+namespace frontend
+{
+namespace tflite
+{
+
+void IrVisitor::visit(const Model *m)
+{
+ opcodes = m->operator_codes();
+ buffers = m->buffers();
+
+ throw std::runtime_error{"Not yet implemented"};
+}
+
+void IrVisitor::visit(const SubGraph *s)
+{
+ tensors = s->tensors();
+
+ throw std::runtime_error{"Not yet implemented"};
+}
+
+void IrVisitor::visit(const Operator *op)
+{
+ throw std::runtime_error{"Not yet implemented"};
+}
+
+void IrVisitor::visit(const Tensor *t) { throw std::runtime_error{"Not yet implemented"}; }
+void IrVisitor::visit(const OperatorCode *) { throw std::runtime_error{"Not yet implemented"}; }
+void IrVisitor::visit(const Buffer *) { throw std::runtime_error{"Not yet implemented"}; }
+
+} // namespace tflite
+} // namespace frontend
+} // namespace contrib
+} // namespace nncc