This commit removes layout manipulation methods from KernelObject.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
const nncc::core::ADT::kernel::Shape &shape(void) const;
public:
- // Deprecated
- ElemID &at(uint32_t n, uint32_t ch, uint32_t row, uint32_t col);
ElemID at(uint32_t n, uint32_t ch, uint32_t row, uint32_t col) const;
public:
- // Deprecated
- void reorder(const nncc::core::ADT::kernel::Layout &l);
- // Deprecated
- template <typename LayoutImpl> void reorder(void) { reorder(LayoutImpl{}); }
-
-public:
const GenericKernelLayout *layout(void) const { return _layout.get(); }
void layout(std::unique_ptr<GenericKernelLayout> &&l) { _layout = std::move(l); }
const nncc::core::ADT::kernel::Shape ker_shape{1, 1, 3, 3};
auto ker_bag = m->entity()->bag()->create(num_elements(ker_shape));
+ auto ker_layout = make_unique<coco::GenericKernelLayout>(ker_shape);
+
+ ker_layout->reorder<NCHWLayout>();
+
auto ker_obj = m->entity()->object()->create(ker_shape);
ker_obj->bag(ker_bag);
- ker_obj->reorder<NCHWLayout>();
+ ker_obj->layout(std::move(ker_layout));
const nncc::core::ADT::feature::Shape ofm_shape{1, 1, 1};
auto ofm_bag = m->entity()->bag()->create(1 * 1 * 1);
const nncc::core::ADT::kernel::Shape &KernelObject::shape(void) const { return _layout->shape(); }
-ElemID &KernelObject::at(uint32_t n, uint32_t ch, uint32_t row, uint32_t col)
-{
- return _layout->at(n, ch, row, col);
-}
-
ElemID KernelObject::at(uint32_t n, uint32_t ch, uint32_t row, uint32_t col) const
{
return _layout->at(n, ch, row, col);
}
-void KernelObject::reorder(const nncc::core::ADT::kernel::Layout &l) { _layout->reorder(l); }
-
} // namespace coco
ASSERT_EQ(mutable_object->asKernel(), immutable_object->asKernel());
}
+// TODO Rewrite this test as a test for GenericKernelLayout
+#if 0
TEST_F(KernelObjectTest, at)
{
const uint32_t N = 1;
}
}
}
+#endif