summaryrefslogtreecommitdiff
path: root/compiler/exo-tflite/src/Dialect/IR/TFLNodes.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/exo-tflite/src/Dialect/IR/TFLNodes.h')
-rw-r--r--compiler/exo-tflite/src/Dialect/IR/TFLNodes.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler/exo-tflite/src/Dialect/IR/TFLNodes.h b/compiler/exo-tflite/src/Dialect/IR/TFLNodes.h
index 42de74806..f12b62d89 100644
--- a/compiler/exo-tflite/src/Dialect/IR/TFLNodes.h
+++ b/compiler/exo-tflite/src/Dialect/IR/TFLNodes.h
@@ -22,6 +22,7 @@
#include <loco/IR/Node.h>
#include <loco/IR/NodeMixins.h>
+#include <loco/IR/DataTypeTraits.h>
#include <array>
@@ -162,6 +163,27 @@ private:
// TODO TFLConcatenation
+/**
+ * @brief Class to build tensor data
+ * @note This will not be exported as a specific op
+ */
+class TFLConst final : public FixedArityNode<0, TFLNodeImpl<TFLOpcode::NOP_CONSTGEN>>,
+ public loco::NodeMixin<loco::NodeTrait::DataType>,
+ public loco::NodeMixin<loco::NodeTrait::TensorShape>
+{
+public:
+ TFLConst() = default;
+
+public:
+ template <loco::DataType DT> uint32_t size(void) const;
+ template <loco::DataType DT> void size(uint32_t size);
+ template <loco::DataType DT> const typename loco::DataTypeImpl<DT>::Type &at(uint32_t n) const;
+ template <loco::DataType DT> typename loco::DataTypeImpl<DT>::Type &at(uint32_t n);
+
+private:
+ std::vector<uint8_t> _data;
+};
+
// TODO TFLConv2D
// TODO TFLDepthwiseConv2D