diff options
author | Chunseok Lee <chunseok.lee@samsung.com> | 2019-01-08 17:36:34 +0900 |
---|---|---|
committer | Chunseok Lee <chunseok.lee@samsung.com> | 2019-01-08 17:36:34 +0900 |
commit | bd11b24234d7d43dfe05a81c520aa01ffad06e42 (patch) | |
tree | 57d0d4044977e4fa0e50cd9ba40b32006dff19eb /tests/tools/tflite_run/src/tensor_dumper.h | |
parent | 91f4ba45449f700a047a4aeea00b1a7c84e94c75 (diff) | |
download | nnfw-bd11b24234d7d43dfe05a81c520aa01ffad06e42.tar.gz nnfw-bd11b24234d7d43dfe05a81c520aa01ffad06e42.tar.bz2 nnfw-bd11b24234d7d43dfe05a81c520aa01ffad06e42.zip |
Imported Upstream version 0.3upstream/0.3
Diffstat (limited to 'tests/tools/tflite_run/src/tensor_dumper.h')
-rw-r--r-- | tests/tools/tflite_run/src/tensor_dumper.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/tools/tflite_run/src/tensor_dumper.h b/tests/tools/tflite_run/src/tensor_dumper.h new file mode 100644 index 000000000..2805f1076 --- /dev/null +++ b/tests/tools/tflite_run/src/tensor_dumper.h @@ -0,0 +1,38 @@ +#ifndef __TFLITE_RUN_TENSOR_DUMPER_H__ +#define __TFLITE_RUN_TENSOR_DUMPER_H__ + +#include <memory> +#include <string> +#include <vector> + +namespace tflite +{ +class Interpreter; +} + +namespace TFLiteRun +{ + +class TensorDumper +{ +private: + struct Tensor + { + int _index; + std::vector<char> _data; + + Tensor(int index, std::vector<char> &&data) : _index(index), _data(std::move(data)) {} + }; + +public: + TensorDumper(); + void addTensors(tflite::Interpreter &interpreter, const std::vector<int> &indices); + void dump(const std::string &filename) const; + +private: + std::vector<Tensor> _tensors; +}; + +} // end of namespace TFLiteRun + +#endif // __TFLITE_RUN_TENSOR_DUMPER_H__ |