This commit adds 'OutputManager' class which serves as 'Output' object
factory.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
--- /dev/null
+#ifndef __COCO_IR_OUTPUT_MANAGER_H__
+#define __COCO_IR_OUTPUT_MANAGER_H__
+
+#include "coco/IR/Output.h"
+
+#include "coco/ADT/PtrManager.h"
+
+namespace coco
+{
+
+struct OutputManager final : public PtrManager<Output>
+{
+ Output *make(const nncc::core::ADT::tensor::Shape &);
+};
+
+} // namespace coco
+
+#endif // __COCO_IR_OUTPUT_MANAGER_H__
--- /dev/null
+#include "coco/IR/OutputManager.h"
+
+#include <nncc/foundation/Memory.h>
+
+namespace coco
+{
+
+Output *OutputManager::make(const nncc::core::ADT::tensor::Shape &shape)
+{
+ return take(nncc::foundation::make_unique<Output>(shape));
+}
+
+} // namespace coco
--- /dev/null
+#include "coco/IR/OutputManager.h"
+
+#include <gtest/gtest.h>
+
+TEST(IR_OUTPUT_MANAGER, make)
+{
+ const nncc::core::ADT::tensor::Shape shape{1, 3, 3, 1};
+
+ coco::OutputManager mgr;
+
+ auto output = mgr.make(shape);
+
+ ASSERT_EQ(output->shape(), shape);
+}