MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / get_input_accessor

Function get_input_accessor

utils/GraphUtils.h:504–534  ·  view source on GitHub ↗

Generates appropriate input accessor according to the specified graph parameters * * @param[in] graph_parameters Graph parameters * @param[in] preprocessor (Optional) Preproccessor object * @param[in] bgr (Optional) Fill the first plane with blue channel (default = true) * * @return An appropriate tensor accessor */

Source from the content-addressed store, hash-verified

502 * @return An appropriate tensor accessor
503 */
504inline std::unique_ptr<graph::ITensorAccessor>
505get_input_accessor(const arm_compute::utils::CommonGraphParams &graph_parameters,
506 std::unique_ptr<IPreprocessor> preprocessor = nullptr,
507 bool bgr = true)
508{
509 if (!graph_parameters.validation_file.empty())
510 {
511 return std::make_unique<ValidationInputAccessor>(
512 graph_parameters.validation_file, graph_parameters.validation_path, std::move(preprocessor), bgr,
513 graph_parameters.validation_range_start, graph_parameters.validation_range_end);
514 }
515 else
516 {
517 const std::string &image_file = graph_parameters.image;
518 const std::string &image_file_lower = lower_string(image_file);
519 if (arm_compute::utility::endswith(image_file_lower, ".npy"))
520 {
521 return std::make_unique<NumPyBinLoader>(image_file, graph_parameters.data_layout);
522 }
523 else if (arm_compute::utility::endswith(image_file_lower, ".jpeg") ||
524 arm_compute::utility::endswith(image_file_lower, ".jpg") ||
525 arm_compute::utility::endswith(image_file_lower, ".ppm"))
526 {
527 return std::make_unique<ImageAccessor>(image_file, bgr, std::move(preprocessor));
528 }
529 else
530 {
531 return std::make_unique<DummyAccessor>();
532 }
533 }
534}
535
536/** Generates appropriate output accessor according to the specified graph parameters
537 *

Callers 15

do_setupMethod · 0.85
do_setupMethod · 0.85
create_graph_floatMethod · 0.85
create_graph_qasymmMethod · 0.85
do_setupMethod · 0.85
do_setupMethod · 0.85
do_setupMethod · 0.85
do_setupMethod · 0.85
do_setupMethod · 0.85
do_setupMethod · 0.85
do_setupMethod · 0.85
do_setupMethod · 0.85

Calls 3

lower_stringFunction · 0.85
endswithFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected