#define __COCO_IR_FEATURE_LAYOUT_H__
#include "coco/IR/ElemID.h"
-
-#include <nncc/core/ADT/feature/Shape.h>
+#include "coco/IR/FeatureShape.h"
namespace coco
{
virtual const ID *id(void) const = 0;
virtual uint32_t batch(void) const = 0;
- virtual const nncc::core::ADT::feature::Shape &shape(void) const = 0;
+ virtual const FeatureShape &shape(void) const = 0;
virtual ElemID at(uint32_t b, uint32_t ch, uint32_t row, uint32_t col) const = 0;
};
class BCHW final : public FeatureLayout
{
private:
- BCHW(uint32_t batch, const nncc::core::ADT::feature::Shape &shape) : _batch{batch}, _shape{shape}
+ BCHW(uint32_t batch, const FeatureShape &shape) : _batch{batch}, _shape{shape}
{
// DO NOTHING
}
const FeatureLayout::ID *id(void) const override { return uid(); }
uint32_t batch(void) const override { return _batch; }
- const nncc::core::ADT::feature::Shape &shape(void) const override { return _shape; }
+ const FeatureShape &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;
+ FeatureShape _shape;
public:
- static std::unique_ptr<BCHW> create(const nncc::core::ADT::feature::Shape &shape);
+ static std::unique_ptr<BCHW> create(const FeatureShape &shape);
};
/**
class BHWC : public coco::FeatureLayout
{
private:
- BHWC(uint32_t batch, const nncc::core::ADT::feature::Shape &shape) : _batch{batch}, _shape{shape}
+ BHWC(uint32_t batch, const FeatureShape &shape) : _batch{batch}, _shape{shape}
{
// DO NOTHING
}
const FeatureLayout::ID *id(void) const override { return uid(); }
uint32_t batch(void) const override { return _batch; }
- const nncc::core::ADT::feature::Shape &shape(void) const override { return _shape; }
+ const FeatureShape &shape(void) const override { return _shape; }
coco::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;
+ FeatureShape _shape;
public:
- static std::unique_ptr<BHWC> create(const nncc::core::ADT::feature::Shape &shape);
+ static std::unique_ptr<BHWC> create(const FeatureShape &shape);
};
/**
class Generic final : public FeatureLayout
{
public:
- Generic(const nncc::core::ADT::feature::Shape &shape);
+ Generic(const FeatureShape &shape);
public:
static const FeatureLayout::ID *uid(void);
const FeatureLayout::ID *id(void) const override { return uid(); }
uint32_t batch(void) const override { return _batch; }
- const nncc::core::ADT::feature::Shape &shape(void) const override { return _shape; }
+ const FeatureShape &shape(void) const override { return _shape; }
ElemID &at(uint32_t b, uint32_t ch, uint32_t row, uint32_t col);
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;
+ FeatureShape _shape;
private:
std::vector<ElemID> _content;
#define __COCO_IR_FEATURE_OBJECT_H__
#include "coco/IR/Object.h"
+#include "coco/IR/FeatureShape.h"
#include "coco/IR/FeatureLayout.h"
#include "coco/IR/ElemID.h"
-#include <nncc/core/ADT/feature/Shape.h>
#include <nncc/core/ADT/feature/Layout.h>
#include <vector>
{
public:
FeatureObject() = default;
- explicit FeatureObject(const nncc::core::ADT::feature::Shape &shape);
+ explicit FeatureObject(const FeatureShape &shape);
public:
~FeatureObject();
const FeatureObject *asFeature(void) const override { return this; }
public:
- const nncc::core::ADT::feature::Shape &shape(void) const;
+ const FeatureShape &shape(void) const;
public:
ElemID at(uint32_t ch, uint32_t row, uint32_t col) const;
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __COCO_IR_FEATURE_SHAPE_H__
+#define __COCO_IR_FEATURE_SHAPE_H__
+
+#include <nncc/core/ADT/feature/Shape.h>
+
+namespace coco
+{
+
+using FeatureShape = nncc::core::ADT::feature::Shape;
+
+} // namespace coco
+
+#endif // __COCO_IR_FEATURE_SHAPE_H__
#define __COCO_IR_OBJECT_MANAGER_H__
#include "coco/IR/Object.h"
+#include "coco/IR/FeatureShape.h"
#include "coco/IR/FeatureObject.forward.h"
#include "coco/IR/KernelObject.forward.h"
#include "coco/IR/EntityBuilder.h"
#include "coco/ADT/PtrManager.h"
#include "coco/ADT/PtrLink.h"
-#include <nncc/core/ADT/feature/Shape.h>
#include <nncc/core/ADT/kernel/Shape.h>
namespace coco
ObjectManager(Module *m = nullptr) { module(m); }
public:
- FeatureObject *create(const nncc::core::ADT::feature::Shape &shape);
+ FeatureObject *create(const FeatureShape &shape);
KernelObject *create(const nncc::core::ADT::kernel::Shape &shape);
template <typename T> T *create(void);