[nncc.core] Remove unused tensor formatting classes (#1335)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Wed, 5 Sep 2018 00:31:55 +0000 (09:31 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 5 Sep 2018 00:31:55 +0000 (09:31 +0900)
This commit removes unused tensor formatting classes from nnnc core
library.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
libs/core/include/nncc/core/ADT/tensor/TextFormatted.h [deleted file]
libs/core/include/nncc/core/ADT/tensor/TextFormattedIndex.h [deleted file]
libs/core/src/ADT/tensor/TextFormattedIndex.cpp [deleted file]
libs/core/src/ADT/tensor/TextFormattedIndex.test.cpp [deleted file]

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 (file)
index dd4277a..0000000
+++ /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 <typename T> class TextFormatted;
-
-template <typename T> TextFormatted<T> txtfmt(const T &obj) { return TextFormatted<T>{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 (file)
index 58c3636..0000000
+++ /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<Index> 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 (file)
index 7bb1ba5..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#include "nncc/core/ADT/tensor/TextFormattedIndex.h"
-
-namespace nncc
-{
-namespace core
-{
-namespace ADT
-{
-namespace tensor
-{
-
-void TextFormatted<Index>::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 (file)
index 8ebe318..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "nncc/core/ADT/tensor/TextFormattedIndex.h"
-
-#include <string>
-#include <sstream>
-
-#include <gtest/gtest.h>
-
-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");
-}