--- /dev/null
+#include "TypeInfo.h"
+
+namespace neurun
+{
+namespace internal
+{
+namespace operand
+{
+
+DataType TypeInfo::typeFromOperandCode(OperandCode type)
+{
+ // Now neurun::internal::operand::DataType share same enum value with OperandCode
+ // in NeuralNetworks.h.
+ return static_cast<DataType>(static_cast<uint32_t>(type));
+}
+
+} // namespace operand
+} // namespace internal
+} // namespace neurun
--- /dev/null
+#ifndef __NEURUN_INTERNAL_OPERAND_TYPEINFO_H__
+#define __NEURUN_INTERNAL_OPERAND_TYPEINFO_H__
+
+#include <cstdint>
+
+#include <NeuralNetworks.h>
+
+#include "DataType.h"
+
+namespace neurun
+{
+namespace internal
+{
+namespace operand
+{
+
+class TypeInfo
+{
+public:
+ TypeInfo(OperandCode type, float scale, int32_t offset)
+ : _type(typeFromOperandCode(type)), _scale(scale), _offset(offset)
+ {
+ // DO NOTHING
+ }
+
+public:
+ DataType type() const { return _type; }
+ float scale() const { return _scale; }
+ int32_t offset() const { return _offset; }
+
+private:
+ // Now neurun::internal::operand::DataType share same enum value with OperandCode
+ // in NeuralNetworks.h.
+ // If we don't share same value, we must fix this mapping function.
+ DataType typeFromOperandCode(OperandCode type);
+
+private:
+ DataType _type;
+ float _scale;
+ int32_t _offset;
+};
+} // namespace operand
+} // namespace internal
+} // namespace neurun
+
+#endif // __NEURUN_INTERNAL_OPERAND_TYPEINFO_H__