diff options
author | Chunseok Lee <chunseok.lee@samsung.com> | 2020-12-14 14:43:43 +0900 |
---|---|---|
committer | Chunseok Lee <chunseok.lee@samsung.com> | 2020-12-14 14:43:43 +0900 |
commit | 62529acabbafce7730601ed01d5709d7bc0d378a (patch) | |
tree | bf6912cfa8fac4a2997292bfcb3c82055734c97e /compiler/luci/lang/include | |
parent | 6ea13af5257155ff993c205cf997b870cc627f73 (diff) | |
download | nnfw-62529acabbafce7730601ed01d5709d7bc0d378a.tar.gz nnfw-62529acabbafce7730601ed01d5709d7bc0d378a.tar.bz2 nnfw-62529acabbafce7730601ed01d5709d7bc0d378a.zip |
Imported Upstream version 1.12.0upstream/1.12.0
Diffstat (limited to 'compiler/luci/lang/include')
5 files changed, 43 insertions, 18 deletions
diff --git a/compiler/luci/lang/include/luci/IR/AttrDilation.h b/compiler/luci/lang/include/luci/IR/AttrDilation.h index c2b28d77d..ed8232576 100644 --- a/compiler/luci/lang/include/luci/IR/AttrDilation.h +++ b/compiler/luci/lang/include/luci/IR/AttrDilation.h @@ -27,15 +27,17 @@ class Dilation final public: Dilation() : _w(1), _h(1) {} - int32_t w() const { return _w; } - void w(int32_t w) { _w = w; } + uint32_t w() const { return _w; } + void w(uint32_t w) { _w = w; } + void w(int32_t w); - int32_t h() const { return _h; } - void h(int32_t h) { _h = h; } + uint32_t h() const { return _h; } + void h(uint32_t h) { _h = h; } + void h(int32_t h); private: - int32_t _w; - int32_t _h; + uint32_t _w; + uint32_t _h; }; } // namespace luci diff --git a/compiler/luci/lang/include/luci/IR/AttrFilter.h b/compiler/luci/lang/include/luci/IR/AttrFilter.h index 7909fa523..af9d7519f 100644 --- a/compiler/luci/lang/include/luci/IR/AttrFilter.h +++ b/compiler/luci/lang/include/luci/IR/AttrFilter.h @@ -27,15 +27,17 @@ class Filter final public: Filter() : _w(1), _h(1) {} - int32_t w() const { return _w; } - void w(int32_t w) { _w = w; } + uint32_t w() const { return _w; } + void w(uint32_t w) { _w = w; } + void w(int32_t w); - int32_t h() const { return _h; } - void h(int32_t h) { _h = h; } + uint32_t h() const { return _h; } + void h(uint32_t h) { _h = h; } + void h(int32_t h); private: - int32_t _w; - int32_t _h; + uint32_t _w; + uint32_t _h; }; } // namespace luci diff --git a/compiler/luci/lang/include/luci/IR/AttrStride.h b/compiler/luci/lang/include/luci/IR/AttrStride.h index 654967d73..6be697975 100644 --- a/compiler/luci/lang/include/luci/IR/AttrStride.h +++ b/compiler/luci/lang/include/luci/IR/AttrStride.h @@ -27,15 +27,17 @@ class Stride final public: Stride() : _w(1), _h(1) {} - int32_t w() const { return _w; } - void w(int32_t w) { _w = w; } + uint32_t w() const { return _w; } + void w(uint32_t w) { _w = w; } + void w(int32_t w); - int32_t h() const { return _h; } - void h(int32_t h) { _h = h; } + uint32_t h() const { return _h; } + void h(uint32_t h) { _h = h; } + void h(int32_t h); private: - int32_t _w; - int32_t _h; + uint32_t _w; + uint32_t _h; }; } // namespace luci diff --git a/compiler/luci/lang/include/luci/IR/CircleShapeSignature.h b/compiler/luci/lang/include/luci/IR/CircleShapeSignature.h index 970f1b521..18a260486 100644 --- a/compiler/luci/lang/include/luci/IR/CircleShapeSignature.h +++ b/compiler/luci/lang/include/luci/IR/CircleShapeSignature.h @@ -46,6 +46,8 @@ private: std::vector<int32_t> _shape_signature{}; }; +bool operator==(const ShapeSignature &lhs, const ShapeSignature &rhs); + } // namespace luci #endif // __LUCI_IR_SHAPE_SIGNATURE_H__ diff --git a/compiler/luci/lang/include/luci/IR/Nodes/CircleFullyConnected.h b/compiler/luci/lang/include/luci/IR/Nodes/CircleFullyConnected.h index d78f39494..952befc87 100644 --- a/compiler/luci/lang/include/luci/IR/Nodes/CircleFullyConnected.h +++ b/compiler/luci/lang/include/luci/IR/Nodes/CircleFullyConnected.h @@ -35,6 +35,16 @@ class CircleFullyConnected final public LuciNodeMixin<LuciNodeTrait::Bias> { public: + enum class WeightsFormat + { + UNDEFINED, // This is not defined by Circle. This was added to prevent programming error. + + DEFAULT, + SHUFFLED4x16INT8, + SHUFFLED16x1FLOAT32, + }; + +public: loco::Node *input(void) const { return at(0)->node(); } void input(loco::Node *node) { at(0)->node(node); } @@ -43,6 +53,13 @@ public: loco::Node *bias(void) const override { return at(2)->node(); } void bias(loco::Node *node) override { at(2)->node(node); } + +public: + WeightsFormat weights_format(void) const { return _weights_format; } + void weights_format(WeightsFormat weights_format) { _weights_format = weights_format; } + +private: + WeightsFormat _weights_format{WeightsFormat::DEFAULT}; }; } // namespace luci |