--- /dev/null
+#ifndef __COCO_IR_FEATURE_LAYOUTS_H__
+#define __COCO_IR_FEATURE_LAYOUTS_H__
+
+#include "coco/IR/FeatureLayout.h"
+
+#include <memory>
+
+namespace coco
+{
+namespace FeatureLayouts
+{
+
+/**
+ * @brief BCHW Feature Layout
+ */
+class BCHW final : public FeatureLayout
+{
+private:
+ BCHW(uint32_t batch, const nncc::core::ADT::feature::Shape &shape) : _batch{batch}, _shape{shape}
+ {
+ // DO NOTHING
+ }
+
+public:
+ uint32_t batch(void) const override { return _batch; }
+ const nncc::core::ADT::feature::Shape &shape(void) const override { return _shape; }
+
+ ElemID at(uint32_t b, uint32_t ch, uint32_t row, uint32_t col) const override;
+
+private:
+ uint32_t _batch;
+ nncc::core::ADT::feature::Shape _shape;
+
+public:
+ static std::unique_ptr<BCHW> create(const nncc::core::ADT::feature::Shape &shape);
+};
+
+} // namespace FeatureLayouts
+} // namespace coco
+
+#endif // __COCO_IR_FEATURE_LAYOUTS_H__
--- /dev/null
+#include "coco/IR/FeatureLayouts.h"
+
+#include <nncc/core/ADT/feature/CHWLayout.h>
+
+using namespace nncc::core::ADT::feature;
+
+//
+// BCHW Layout
+//
+namespace coco
+{
+namespace FeatureLayouts
+{
+
+ElemID BCHW::at(uint32_t b, uint32_t ch, uint32_t row, uint32_t col) const
+{
+ static CHWLayout l;
+
+ uint32_t offset = 0;
+ offset += b * num_elements(_shape);
+ offset += l.offset(_shape, ch, row, col);
+ return ElemID{offset};
+}
+
+std::unique_ptr<BCHW> BCHW::create(const nncc::core::ADT::feature::Shape &shape)
+{
+ // NOTE It is impossible to use make_unique here as the constructor is private
+ return std::unique_ptr<BCHW>{new BCHW{1, shape}};
+}
+
+} // namespace FeatureLayouts
+} // namespace coco