34 class GraphVGG19Example :
public Example 38 : cmd_parser(), common_opts(cmd_parser), common_params(), graph(0,
"VGG19")
41 bool do_setup(
int argc,
char **argv)
override 44 cmd_parser.parse(argc, argv);
45 cmd_parser.validate();
51 if(common_params.help)
53 cmd_parser.print_help(argv[0]);
58 std::cout << common_params << std::endl;
61 std::string data_path = common_params.data_path;
64 const std::array<float, 3> mean_rgb{ { 123.68f, 116.779f, 103.939f } };
65 std::unique_ptr<IPreprocessor> preprocessor = std::make_unique<CaffePreproccessor>(mean_rgb);
68 const auto operation_layout = common_params.data_layout;
75 graph << common_params.target
76 << common_params.fast_math_hint
83 PadStrideInfo(1, 1, 1, 1))
90 PadStrideInfo(1, 1, 1, 1))
99 PadStrideInfo(1, 1, 1, 1))
106 PadStrideInfo(1, 1, 1, 1))
115 PadStrideInfo(1, 1, 1, 1))
122 PadStrideInfo(1, 1, 1, 1))
129 PadStrideInfo(1, 1, 1, 1))
136 PadStrideInfo(1, 1, 1, 1))
145 PadStrideInfo(1, 1, 1, 1))
152 PadStrideInfo(1, 1, 1, 1))
159 PadStrideInfo(1, 1, 1, 1))
166 PadStrideInfo(1, 1, 1, 1))
175 PadStrideInfo(1, 1, 1, 1))
182 PadStrideInfo(1, 1, 1, 1))
189 PadStrideInfo(1, 1, 1, 1))
196 PadStrideInfo(1, 1, 1, 1))
227 config.
use_tuner = common_params.enable_tuner;
230 config.
mlgo_file = common_params.mlgo_file;
233 graph.finalize(common_params.target, config);
237 void do_run()
override 264 int main(
int argc,
char **argv)
266 return arm_compute::utils::run_example<GraphVGG19Example>(argc, argv);
Graph configuration structure Device target types.
CLTunerMode tuner_mode
Tuner mode to be used by the CL tuner.
std::unique_ptr< graph::ITensorAccessor > get_input_accessor(const arm_compute::utils::CommonGraphParams &graph_parameters, std::unique_ptr< IPreprocessor > preprocessor=nullptr, bool bgr=true)
Generates appropriate input accessor according to the specified graph parameters. ...
bool convert_to_uint8
Convert graph to a synthetic uint8 graph.
void consume_common_graph_parameters(CommonGraphValidateOptions &options, CommonParams &common_params)
Consumes the consume_common_graph_parameters graph options and creates a structure containing any inf...
Includes all the Graph headers at once.
Common command line options used to configure the graph examples.
Class to parse command line arguments.
std::string mlgo_file
Filename to load MLGO heuristics from.
std::string tuner_file
File to load/store tuning values from.
int main(int argc, char **argv)
Main program for VGG19.
quantized, asymmetric fixed-point 8-bit number unsigned
Num samples, channels, height, width.
TensorShape permute_shape(TensorShape tensor_shape, DataLayout in_data_layout, DataLayout out_data_layout)
Permutes a given tensor shape given the input and output data layout.
TensorDescriptor & set_layout(DataLayout data_layout)
Sets tensor descriptor data layout.
Structure holding all the common graph parameters.
std::unique_ptr< graph::ITensorAccessor > get_output_accessor(const arm_compute::utils::CommonGraphParams &graph_parameters, size_t top_n=5, bool is_validation=false, std::ostream &output_stream=std::cout)
Generates appropriate output accessor according to the specified graph parameters.
bool use_tuner
Use a tuner in tunable backends.
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.
int num_threads
Number of threads to use (thread capable backends), if 0 the backend will auto-initialize, if -1 the backend will stay as it is.
Stream frontend class to construct simple graphs in a stream fashion.
DataLayout
[DataLayout enum definition]
ILayer & set_name(std::string name)
Sets the name of the layer.