diff options
author | Chunseok Lee <chunseok.lee@samsung.com> | 2020-03-05 15:10:09 +0900 |
---|---|---|
committer | Chunseok Lee <chunseok.lee@samsung.com> | 2020-03-05 15:22:53 +0900 |
commit | d91a039e0eda6fd70dcd22672b8ce1817c1ca50e (patch) | |
tree | 62668ec548cf31fadbbf4e99522999ad13434a25 /runtimes/neurun/core/include/util/feature/Coordinate4D.h | |
parent | bd11b24234d7d43dfe05a81c520aa01ffad06e42 (diff) | |
download | nnfw-d91a039e0eda6fd70dcd22672b8ce1817c1ca50e.tar.gz nnfw-d91a039e0eda6fd70dcd22672b8ce1817c1ca50e.tar.bz2 nnfw-d91a039e0eda6fd70dcd22672b8ce1817c1ca50e.zip |
catch up to tizen_5.5 and remove unness dir
- update to tizen_5.5
- remove dirs
Diffstat (limited to 'runtimes/neurun/core/include/util/feature/Coordinate4D.h')
-rw-r--r-- | runtimes/neurun/core/include/util/feature/Coordinate4D.h | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/runtimes/neurun/core/include/util/feature/Coordinate4D.h b/runtimes/neurun/core/include/util/feature/Coordinate4D.h new file mode 100644 index 000000000..b020ed239 --- /dev/null +++ b/runtimes/neurun/core/include/util/feature/Coordinate4D.h @@ -0,0 +1,111 @@ +/* + * 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 __NEURUN_UTIL_FEATURE_COORDINATE_4D_H__ +#define __NEURUN_UTIL_FEATURE_COORDINATE_4D_H__ + +#include <stdint.h> + +namespace neurun +{ +namespace util +{ +namespace feature +{ + +/** + * @brief Class to represent position(offset) of subtensor.\n + * Assume that parent and child are already lowered (can get Shape4D). + */ +class Coordinate4D +{ +public: + /** + * @brief Construct a new Coordinate4D object + */ + Coordinate4D(void) : _n{0}, _h{0}, _w{0}, _c{0} + { + // DO NOTHING + } + /** + * @brief Construct a new Coordinate4D object + * @param[in] n Batch offset + * @param[in] h Height offset + * @param[in] w Width offset + * @param[in] c Channel offset + * @return + */ + Coordinate4D(int32_t n, int32_t h, int32_t w, int32_t c) : _n{n}, _h{h}, _w{w}, _c{c} + { + // DO NOTHING + } + +public: + /** + * @brief Set batch offset + * @param[in] n Batch offset + */ + void n(int32_t n) { _n = n; } + /** + * @brief Set height offset + * @param[in] h Height offset + */ + void h(int32_t h) { _h = h; } + /** + * @brief Set width offset + * @param[in] w Width offset + */ + void w(int32_t w) { _w = w; } + /** + * @brief Set channel offset + * @param[in] c Channel offset + */ + void c(int32_t c) { _c = c; } + +public: + /** + * @brief Return batch offset + * @return Batch offset + */ + int32_t n(void) const { return _n; } + /** + * @brief Return height offset + * @return Height offset + */ + int32_t h(void) const { return _h; } + /** + * @brief Return width offset + * @return Width offset + */ + int32_t w(void) const { return _w; } + /** + * @brief Return channel offset + * @return Channel offset + */ + int32_t c(void) const { return _c; } + +private: + int32_t _n; + int32_t _h; + int32_t _w; + int32_t _c; +}; + +} // namespace feature +} // namespace util +} // namespace neurun + +#endif // __NEURUN_UTIL_FEATURE_COORDINATE_4D_H__ |