summaryrefslogtreecommitdiff
path: root/tests/tools/nnpackage_run/src/tensor_dumper.h
blob: f274ad64647c93613a33d8fe8b879da58e14afd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef __NNPACKAGE_RUN_TENSOR_DUMPER_H__
#define __NNPACKAGE_RUN_TENSOR_DUMPER_H__

#include <memory>
#include <string>
#include <vector>
#include <stddef.h>
#include <fstream>

#include "nnfw.h"

namespace NNPackageRun
{

class TensorDumper
{
public:
  TensorDumper(const std::string &filename);
  void dumpTensor(const nnfw_tensorinfo ti, void *buffer, size_t bytes);
  void dumpInt32(int32_t i);
  void dumpSizeT(size_t i);
  ~TensorDumper();

private:
  static constexpr int version = 1;
  std::ofstream file_;
};

} // end of namespace NNPackageRun

#endif // __NNPACKAGE_RUN_TENSOR_DUMPER_H__