$(NNTRAINER_ROOT)/nntrainer/utils/node_exporter.cpp \
$(NNTRAINER_ROOT)/nntrainer/utils/base_properties.cpp \
$(NNTRAINER_ROOT)/nntrainer/compiler/ini_interpreter.cpp \
+ $(NNTRAINER_ROOT)/nntrainer/compiler/flatten_realizer.cpp \
$(NNTRAINER_ROOT)/nntrainer/app_context.cpp
ifeq ($(ENABLE_TFLITE_INTERPRETER), 1)
--- /dev/null
+// SPDX-License-Identifier: Apache-2.0
+/**
+ * Copyright (C) 2021 Jihoon Lee <jhoon.it.lee@samsung.com>
+ *
+ * @file flatten_realizer.h
+ * @date 09 October 2021
+ * @brief NNTrainer graph realizer which realizes flatten=true to actual node
+ * @see https://github.com/nnstreamer/nntrainer
+ * @author Jihoon Lee <jhoon.it.lee@samsung.com>
+ * @bug No known bugs except for NYI items
+ */
+#include <flatten_realizer.h>
+
+#include <layer_node.h>
+
+namespace nntrainer {
+
+FlattenRealizer::~FlattenRealizer() {}
+
+GraphRepresentation
+FlattenRealizer::realize(const GraphRepresentation &reference) {
+ /// NYI
+ return reference;
+}
+} // namespace nntrainer
--- /dev/null
+// SPDX-License-Identifier: Apache-2.0
+/**
+ * Copyright (C) 2021 Jihoon Lee <jhoon.it.lee@samsung.com>
+ *
+ * @file flatten_realizer.h
+ * @date 09 October 2021
+ * @brief NNTrainer graph realizer which realizes flatten=true to actual node
+ * @see https://github.com/nnstreamer/nntrainer
+ * @author Jihoon Lee <jhoon.it.lee@samsung.com>
+ * @bug No known bugs except for NYI items
+ */
+#ifndef __FLATTEN_REALIZER_H__
+#define __FLATTEN_REALIZER_H__
+
+#include <memory>
+#include <vector>
+
+#include <realizer.h>
+
+namespace nntrainer {
+
+/**
+ * @brief Graph realizer class
+ *
+ */
+class FlattenRealizer final : public GraphRealizer {
+public:
+ /**
+ * @brief Destroy the Graph Realizer object
+ *
+ */
+ ~FlattenRealizer();
+
+ /**
+ * @brief graph realizer creates a new graph based on the reference
+ *
+ */
+ GraphRepresentation realize(const GraphRepresentation &reference) override;
+};
+
+} // namespace nntrainer
+
+#endif // __FLATTEN_REALIZER_H__
#include <memory>
#include <string>
-
-#include <layer_node.h>
+#include <vector>
namespace nntrainer {
class NetworkGraph;
+class LayerNode;
using GraphRepresentation = std::vector<std::shared_ptr<LayerNode>>;
/**
compiler_sources = [
- 'ini_interpreter.cpp'
+ 'ini_interpreter.cpp',
+ 'flatten_realizer.cpp'
]
compiler_headers = []
--- /dev/null
+// SPDX-License-Identifier: Apache-2.0
+/**
+ * Copyright (C) 2021 Jihoon Lee <jhoon.it.lee@samsung.com>
+ *
+ * @file realizer.h
+ * @date 09 October 2021
+ * @brief NNTrainer graph realizer which preprocess graph representation as a
+ * lowering process of compile
+ * @see https://github.com/nnstreamer/nntrainer
+ * @author Jihoon Lee <jhoon.it.lee@samsung.com>
+ * @bug No known bugs except for NYI items
+ */
+#ifndef __REALIZER_H__
+#define __REALIZER_H__
+
+#include <memory>
+#include <vector>
+
+namespace nntrainer {
+
+class LayerNode;
+using GraphRepresentation = std::vector<std::shared_ptr<LayerNode>>;
+
+/**
+ * @brief Graph realizer class
+ *
+ */
+class GraphRealizer {
+public:
+ /**
+ * @brief Destroy the Graph Realizer object
+ *
+ */
+ virtual ~GraphRealizer() {}
+
+ /**
+ * @brief graph realizer creates a new graph based on the reference
+ *
+ */
+ virtual GraphRepresentation realize(const GraphRepresentation &reference) = 0;
+};
+
+} // namespace nntrainer
+
+#endif // __REALIZER_H__