1 //
2 //  config.hpp
3 //  MNNConverter
4 //
5 //  Created by MNN on 2019/01/31.
6 //  Copyright © 2018, Alibaba Group Holding Limited
7 //
8 
9 #ifndef CONFIG_HPP
10 #define CONFIG_HPP
11 #include <string>
12 #include <MNN/MNNDefine.h>
13 
14 class MNN_PUBLIC modelConfig {
15 public:
modelConfig()16     modelConfig()
17         : MNNModel(),
18           prototxtFile(),
19           modelFile(),
20           bizCode("MNN"),
21           model(modelConfig::MAX_SOURCE),
22           benchmarkModel(false),
23           saveHalfFloat(false){
24     }
25     enum MODEL_SOURCE { TENSORFLOW = 0, CAFFE, ONNX, MNN, TFLITE, TORCH, MAX_SOURCE };
26 
27     // MNN model path
28     std::string MNNModel;
29     // if model is tensorflow, this value is NULL;
30     std::string prototxtFile;
31     // tensorflow pb, or caffe model
32     std::string modelFile;
33     // bizCode
34     std::string bizCode;
35     // input config file
36     std::string inputConfigFile;
37     // model source
38     MODEL_SOURCE model;
39     bool benchmarkModel;
40     bool saveHalfFloat;
41     bool forTraining = false;
42     int weightQuantBits = 0;// If weightQuantBits > 0, it means the bit
43     bool weightQuantAsymmetric = false;
44     // The path of the model compression file that stores the int8 calibration table
45     // or sparse parameters.
46     std::string compressionParamsFile = "";
47     bool saveStaticModel = false;
48     int optimizePrefer = 0;
49     float targetVersion = 1.2;
50     int defaultBatchSize = 0;
51     int optimizeLevel = 1;
52 };
53 
54 #endif // CONFIG_HPP
55