Skip to content

Commit

Permalink
Fix incorrect argc calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
liamsun2019 authored and sunshinemyson committed Jan 7, 2025
1 parent 7c582a4 commit e928db0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/minimal/minimal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ void setupInput(int argc,
auto input_list = interpreter->inputs();
bool use_random_input = false;

if ((!is_cache_mode && input_list.size() != argc - 4) ||
(is_cache_mode && input_list.size() != argc - 6)) {
if ((!is_cache_mode && input_list.size() != argc - 3) ||
(is_cache_mode && input_list.size() != argc - 5)) {
std::cout << "Warning: input count not match between command line and "
"model -> generate random data for inputs"
<< std::endl;
use_random_input = true;
}
uint32_t i = is_cache_mode ? 6 : 4;
uint32_t i = is_cache_mode ? 5 : 3;
//uint32_t i = 4; // argv index

for (auto input_idx = 0; input_idx < input_list.size(); input_idx++) {
Expand Down

0 comments on commit e928db0

Please sign in to comment.