41 class GraphLenetExample :
public Example 44 void do_setup(
int argc,
char **argv)
override 46 std::string data_path;
47 unsigned int batches = 4;
50 const int target = argc > 1 ? std::strtol(argv[1],
nullptr, 10) : 0;
59 std::cout <<
"Usage: " << argv[0] <<
" [target] [path_to_data] [batches] [fast_math_hint]\n\n";
60 std::cout <<
"No data folder provided: using random values\n\n";
64 std::cout <<
"Usage: " << argv[0] <<
" " << argv[1] <<
" [path_to_data] [batches] [fast_math_hint]\n\n";
65 std::cout <<
"No data folder provided: using random values\n\n";
71 std::cout <<
"Usage: " << argv[0] <<
" [path_to_data] [batches] [fast_math_hint]\n\n";
72 std::cout <<
"No number of batches where specified, thus will use the default : " << batches <<
"\n\n";
77 batches = std::strtol(argv[3],
nullptr, 0);
78 std::cout <<
"Usage: " << argv[0] <<
" " << argv[1] <<
" " << argv[2] <<
" " << argv[3] <<
" [fast_math_hint]\n\n";
79 std::cout <<
"No fast math info provided: disabling fast math\n\n";
85 batches = std::strtol(argv[3],
nullptr, 0);
86 fast_math_hint = (std::strtol(argv[4],
nullptr, 1) == 0) ? FastMathHint::DISABLED : FastMathHint::ENABLED;
97 PadStrideInfo(1, 1, 0, 0))
104 PadStrideInfo(1, 1, 0, 0))
123 config.use_tuner = (target == 2);
124 graph.finalize(target_hint, config);
126 void do_run()
override 133 Stream graph{ 0,
"LeNet" };
141 int main(
int argc,
char **argv)
143 return arm_compute::utils::run_example<GraphLenetExample>(argc, argv);
graph::Target set_target_hint(int target)
Utility function to return the TargetHint.
std::unique_ptr< graph::ITensorAccessor > get_output_accessor(const std::string &labels_path, size_t top_n=5, std::ostream &output_stream=std::cout)
Generates appropriate output accessor according to the specified labels_path.
1 channel, 1 F32 per channel
std::unique_ptr< graph::ITensorAccessor > get_input_accessor(const std::string &ppm_path, std::unique_ptr< IPreprocessor > preprocessor=nullptr, bool bgr=true)
Generates appropriate input accessor according to the specified ppm_path.
int main(int argc, char **argv)
Main program for LeNet.
FastMathHint
Enable or disable fast math for Convolution layer.
std::unique_ptr< graph::ITensorAccessor > get_weights_accessor(const std::string &path, const std::string &data_file, DataLayout file_layout=DataLayout::NCHW)
Generates appropriate weights accessor according to the specified path.
Stream frontend class to construct simple graphs in a stream fashion.
ILayer & set_name(std::string name)
Sets the name of the layer.