ONE - On-device Neural Engine
|
Data Structures | |
class | BadOption |
simple exception class for invalid options More... | |
class | CommandLine |
this class describes a common command line interface More... | |
class | IOption |
interface for Option class More... | |
class | Option |
this class describes command line option More... | |
class | OptionType |
a class models option type More... | |
class | OptionType< T, false > |
class | OptionType< T, true > |
Functions | |
std::vector< std::string > | optname (const char *names) |
convert option names for Option constructor | |
std::string | overview (const char *descr) |
convert option overview for Option constructor | |
bool | optional (bool is_optional) |
convert option overview for Option constructor | |
std::vector< std::string > | optvalues (const char *vals) |
register valid values for option | |
std::vector< char > | separators (const char *seps) |
separators that separate option name and its value | |
bool | showopt (bool is_shown) |
void | checkInFile (const Option< std::string > &in_file) |
void | checkOutFile (const Option< std::string > &out_file) |
void | checkInDir (const Option< std::string > &dir) |
void | checkOutDir (const Option< std::string > &dir) |
Variables | |
Option< bool > | Help (optname("--help, -h"), overview("print usage and exit"), false, optional(true)) |
Option< bool > | caffeFrontend (optname("--caffe"), overview("treat input file as Caffe model"), false, optional(true), optvalues(""), nullptr, separators(""), showopt(false)) |
Option< bool > | onnxFrontend (optname("--onnx"), overview("treat input file as ONNX model"), false, optional(true), optvalues(""), nullptr, separators(""), showopt(false)) |
Option< bool > | caffe2Frontend (optname("--caffe2"), overview("treat input file as Caffe2 model (predict_net.pb)"), false, optional(false), optvalues(""), nullptr, separators(""), showopt(false), IOption::Group::caffe2) |
Option< std::vector< int > > | inputShapes (optname("--input-shape"), overview("Shape of caffe2 input"), std::vector< int >{}, optional(false), optvalues(""), nullptr, separators(""), showopt(false), IOption::Group::caffe2) |
Option< std::string > | initNet (optname("--init-net"), overview("path to Caffe2 model weights (init_net.pb)"), std::string(), optional(false), optvalues(""), checkInFile, separators(""), showopt(false), IOption::Group::caffe2) |
Option< bool > | tflFrontend (optname("--tflite"), overview("treat input file as Tensor Flow Lite model"), false, optional(true), optvalues(""), nullptr, separators(""), showopt(false)) |
Option< std::string > | target (optname("--target"), overview("select target language to emit for given architecture." "Valid values are '" NNC_TARGET_ARM_CPP "', '" NNC_TARGET_X86_CPP "', '" NNC_TARGET_ARM_GPU_CPP "', '" NNC_TARGET_INTERPRETER "'"), std::string(), optional(false), optvalues(NNC_TARGET_ARM_CPP "," NNC_TARGET_X86_CPP "," NNC_TARGET_ARM_GPU_CPP "," NNC_TARGET_INTERPRETER), nullptr, separators("=")) |
Option< std::string > | inputFile (optname("--nnmodel, -m"), overview("specify input file with serialized NN models"), std::string(), optional(false), optvalues(""), checkInFile) |
Option< bool > | doOptimizationPass (optname("-O"), overview("whether to optimize model or not"), false, optional(true), optvalues(""), nullptr, separators(""), showopt(true)) |
Option< bool > | dumpGraph (optname("--dump, -D"), overview("dump graph to dot files after optimization passes"), false, optional(true), optvalues(""), nullptr, separators(""), showopt(true)) |
Option< std::string > | artifactName (optname("--output, -o"), overview("specify name for output files"), "nnmodel", optional(true), optvalues(""), checkOutFile) |
Option< std::string > | artifactDir (optname("--output-dir, -d"), overview("specify directory for output files"), ".", optional(true), optvalues(""), checkOutDir, separators("=")) |
Option< std::string > | interInputDataDir (optname("--input-data-dir"), overview("specify directory with binary files " "containing the input data for the model " "(one file for each input with the same name)"), ".", optional(true), optvalues(""), checkInDir) |
void nnc::cli::checkInDir | ( | const Option< std::string > & | dir | ) |
Definition at line 47 of file CLOptionChecker.cpp.
void nnc::cli::checkInFile | ( | const Option< std::string > & | in_file | ) |
Definition at line 27 of file CLOptionChecker.cpp.
void nnc::cli::checkOutDir | ( | const Option< std::string > & | dir | ) |
Definition at line 57 of file CLOptionChecker.cpp.
void nnc::cli::checkOutFile | ( | const Option< std::string > & | out_file | ) |
Definition at line 38 of file CLOptionChecker.cpp.
|
inline |
convert option overview for Option constructor
Definition at line 413 of file CommandLine.h.
std::vector< std::string > nnc::cli::optname | ( | const char * | names | ) |
convert option names for Option constructor
names | - name of option, if option has several names then names must be represented by a string separated by a comma |
Definition at line 71 of file CommandLine.cpp.
Referenced by nnc::cli::CommandLine::parseCommandLine().
std::vector< std::string > nnc::cli::optvalues | ( | const char * | vals | ) |
register valid values for option
vals | - valid values of option, if option has several that values then vals must be represented by a string separated by a comma |
Definition at line 73 of file CommandLine.cpp.
|
inline |
convert option overview for Option constructor
Definition at line 404 of file CommandLine.h.
References overview().
Referenced by overview().
std::vector< char > nnc::cli::separators | ( | const char * | seps | ) |
separators that separate option name and its value
seps | - chars of separators separated by a comma |
Definition at line 75 of file CommandLine.cpp.
|
inline |
is_shown | - if set to false, then option won't be shown in help message |
Definition at line 431 of file CommandLine.h.
Option< std::string > nnc::cli::artifactDir | ( | optname("--output-dir, -d") | , |
overview("specify directory for output files") | , | ||
"." | , | ||
optional(true) | , | ||
optvalues("") | , | ||
checkOutDir | , | ||
separators("=") | |||
) |
Option< bool > nnc::cli::caffe2Frontend | ( | optname("--caffe2") | , |
overview("treat input file as Caffe2 model (predict_net.pb)") | , | ||
false | , | ||
optional(false) | , | ||
optvalues("") | , | ||
nullptr | , | ||
separators("") | , | ||
showopt(false) | , | ||
IOption::Group::caffe2 | |||
) |
Option< bool > nnc::cli::Help(optname("--help, -h"), overview("print usage and exit"), false, optional(true)) | ( | optname("--help, -h") | , |
overview("print usage and exit") | , | ||
false | , | ||
optional(true) | |||
) |
Options for compiler driver
Option< std::string > nnc::cli::initNet | ( | optname("--init-net") | , |
overview("path to Caffe2 model weights (init_net.pb)") | , | ||
std::string() | , | ||
optional(false) | , | ||
optvalues("") | , | ||
checkInFile | , | ||
separators("") | , | ||
showopt(false) | , | ||
IOption::Group::caffe2 | |||
) |
Option< std::vector< int > > nnc::cli::inputShapes | ( | optname("--input-shape") | , |
overview("Shape of caffe2 input") | , | ||
std::vector< int >{} | , | ||
optional(false) | , | ||
optvalues("") | , | ||
nullptr | , | ||
separators("") | , | ||
showopt(false) | , | ||
IOption::Group::caffe2 | |||
) |
Option< std::string > nnc::cli::target | ( | optname("--target") | , |
overview("select target language to emit for given architecture." "Valid values are '" NNC_TARGET_ARM_CPP "', '" NNC_TARGET_X86_CPP "', '" NNC_TARGET_ARM_GPU_CPP "', '" NNC_TARGET_INTERPRETER "'") | , | ||
std::string() | , | ||
optional(false) | , | ||
optvalues(NNC_TARGET_ARM_CPP "," NNC_TARGET_X86_CPP "," NNC_TARGET_ARM_GPU_CPP "," NNC_TARGET_INTERPRETER) | , | ||
nullptr | , | ||
separators("=") | |||
) |