From 7121903946e824cf30075b7f948ccb36988ac6a3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Staff=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Wed, 5 Sep 2018 09:31:55 +0900 Subject: [PATCH] [nncc.core] Remove unused tensor formatting classes (#1335) This commit removes unused tensor formatting classes from nnnc core library. Signed-off-by: Jonghyun Park --- .../include/nncc/core/ADT/tensor/TextFormatted.h | 22 ------------- .../nncc/core/ADT/tensor/TextFormattedIndex.h | 38 ---------------------- libs/core/src/ADT/tensor/TextFormattedIndex.cpp | 33 ------------------- .../src/ADT/tensor/TextFormattedIndex.test.cpp | 17 ---------- 4 files changed, 110 deletions(-) delete mode 100644 libs/core/include/nncc/core/ADT/tensor/TextFormatted.h delete mode 100644 libs/core/include/nncc/core/ADT/tensor/TextFormattedIndex.h delete mode 100644 libs/core/src/ADT/tensor/TextFormattedIndex.cpp delete mode 100644 libs/core/src/ADT/tensor/TextFormattedIndex.test.cpp diff --git a/libs/core/include/nncc/core/ADT/tensor/TextFormatted.h b/libs/core/include/nncc/core/ADT/tensor/TextFormatted.h deleted file mode 100644 index dd4277a..0000000 --- a/libs/core/include/nncc/core/ADT/tensor/TextFormatted.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef __NNCC_CORE_ADT_TENSOR_TEXT_FORMATTED_H__ -#define __NNCC_CORE_ADT_TENSOR_TEXT_FORMATTED_H__ - -namespace nncc -{ -namespace core -{ -namespace ADT -{ -namespace tensor -{ - -template class TextFormatted; - -template TextFormatted txtfmt(const T &obj) { return TextFormatted{obj}; } - -} // namespace tensor -} // namespace ADT -} // namespace core -} // namespace nncc - -#endif // __NNCC_CORE_ADT_TENSOR_TEXT_FORMATTED_INDEX_H__ diff --git a/libs/core/include/nncc/core/ADT/tensor/TextFormattedIndex.h b/libs/core/include/nncc/core/ADT/tensor/TextFormattedIndex.h deleted file mode 100644 index 58c3636..0000000 --- a/libs/core/include/nncc/core/ADT/tensor/TextFormattedIndex.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef __NNCC_CORE_ADT_TENSOR_TEXT_FORMATTED_INDEX_H__ -#define __NNCC_CORE_ADT_TENSOR_TEXT_FORMATTED_INDEX_H__ - -#include "nncc/core/ADT/tensor/Index.h" -#include "nncc/core/ADT/tensor/TextFormatted.h" - -#include "nncc/core/ADT/Printable.h" - -namespace nncc -{ -namespace core -{ -namespace ADT -{ -namespace tensor -{ - -template <> class TextFormatted final : public nncc::core::ADT::Printable -{ -public: - explicit TextFormatted(const Index &index) : _index(index) - { - // DO NOTHING - } - -public: - void print(std::ostream &os) const override; - -private: - const Index &_index; -}; - -} // namespace tensor -} // namespace ADT -} // namespace core -} // namespace nncc - -#endif // __NNCC_CORE_ADT_TENSOR_TEXT_FORMATTED_INDEX_H__ diff --git a/libs/core/src/ADT/tensor/TextFormattedIndex.cpp b/libs/core/src/ADT/tensor/TextFormattedIndex.cpp deleted file mode 100644 index 7bb1ba5..0000000 --- a/libs/core/src/ADT/tensor/TextFormattedIndex.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "nncc/core/ADT/tensor/TextFormattedIndex.h" - -namespace nncc -{ -namespace core -{ -namespace ADT -{ -namespace tensor -{ - -void TextFormatted::print(std::ostream &os) const -{ - const auto rank = _index.rank(); - - if (rank > 0) - { - os << _index.at(0); - - if (rank > 1) - { - for (uint32_t axis = 1; axis < rank; ++axis) - { - os << ", " << _index.at(axis); - } - } - } -} - -} // namespace tensor -} // namespace ADT -} // namespace core -} // namespace nncc diff --git a/libs/core/src/ADT/tensor/TextFormattedIndex.test.cpp b/libs/core/src/ADT/tensor/TextFormattedIndex.test.cpp deleted file mode 100644 index 8ebe318..0000000 --- a/libs/core/src/ADT/tensor/TextFormattedIndex.test.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "nncc/core/ADT/tensor/TextFormattedIndex.h" - -#include -#include - -#include - -TEST(ADT_TENSOR_TEXT_FORMATTED_INDEX, message) -{ - const nncc::core::ADT::tensor::Index index{2, 3}; - - std::stringstream ss; - - ss << nncc::core::ADT::tensor::txtfmt(index); - - ASSERT_EQ(ss.str(), "2, 3"); -} -- 2.7.4