For consistency, this commit introduces depth/height/width method to
FeatureLayout class.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
virtual uint32_t batch(void) const = 0;
virtual const FeatureShape &shape(void) const = 0;
+ uint32_t depth(void) const { return shape().depth(); }
+ uint32_t height(void) const { return shape().height(); }
+ uint32_t width(void) const { return shape().width(); }
+
virtual ElemID at(uint32_t b, uint32_t ch, uint32_t row, uint32_t col) const = 0;
};
auto l = coco::FeatureLayouts::BC::create(feature::Shape{C, H, W});
ASSERT_EQ(l->batch(), B);
+ ASSERT_EQ(l->depth(), C);
+ ASSERT_EQ(l->height(), H);
+ ASSERT_EQ(l->width(), W);
// Check whether BC layout is actually channel-wise
for (uint32_t b = 0; b < B; ++b)