[core.ADT.tensor] Add 'Accessor' interface (#231)
author박종현/동작제어Lab(SR)/Senior Engineer/삼성전자 <jh1302.park@samsung.com>
Fri, 18 May 2018 00:08:45 +0000 (09:08 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 18 May 2018 00:08:45 +0000 (09:08 +0900)
This commit introduces 'Accessor<T>' interface over tensor values.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
libs/core/include/nncc/core/ADT/tensor/Accessor.h [new file with mode: 0644]

diff --git a/libs/core/include/nncc/core/ADT/tensor/Accessor.h b/libs/core/include/nncc/core/ADT/tensor/Accessor.h
new file mode 100644 (file)
index 0000000..2f76a9d
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef __NNCC_CORE_ADT_TENSOR_ACCESSOR_H__
+#define __NNCC_CORE_ADT_TENSOR_ACCESSOR_H__
+
+#include "nncc/core/ADT/tensor/Index.h"
+
+namespace nncc
+{
+namespace core
+{
+namespace ADT
+{
+namespace tensor
+{
+
+template <typename T> struct Accessor
+{
+  virtual ~Accessor() = default;
+
+  virtual T &at(const Index &) = 0;
+};
+
+} // namespace tensor
+} // namespace ADT
+} // namespace core
+} // namespace nncc
+
+#endif // __NNCC_CORE_ADT_TENSOR_ACCESSOR_H__