This commit revises ObjectManager to allow users to construct FeatureObject
with empty layout.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
class FeatureObject final : public Object
{
public:
+ FeatureObject() = default;
explicit FeatureObject(std::unique_ptr<FeatureObjectInfo> &&info);
public:
public:
FeatureObject *create(const nncc::core::ADT::feature::Shape &shape);
KernelObject *create(const nncc::core::ADT::kernel::Shape &shape);
+
+ template <typename T> T *create(void);
};
} // namespace coco
namespace coco
{
+template <> FeatureObject *ObjectManager::create(void)
+{
+ auto feature = make_unique<FeatureObject>();
+ modulize(feature.get());
+ return take(std::move(feature));
+}
+
FeatureObject *ObjectManager::create(const nncc::core::ADT::feature::Shape &shape)
{
auto info = make_unique<FeatureObjectInfo>(shape);
ASSERT_EQ(o->shape().height(), shape.height());
ASSERT_EQ(o->shape().width(), shape.width());
}
+
+TEST(IR_OBJECT_MANAGER, create_feature_with_template)
+{
+ coco::ObjectManager mgr;
+
+ auto feature = mgr.create<coco::FeatureObject>();
+
+ ASSERT_EQ(feature->layout(), nullptr);
+}