@@ -44,11 +44,6 @@ DEFINE_string(
4444 " prof_result.bin" ,
4545 " ExecuTorch profiler output path." );
4646
47- DEFINE_bool (
48- bundled_program,
49- false ,
50- " True for running bundled program, false for executorch_flatbuffer::program" );
51-
5247DEFINE_int32 (
5348 testset_idx,
5449 0 ,
@@ -198,22 +193,18 @@ int main(int argc, char** argv) {
198193 MemoryAllocator bundled_input_allocator{
199194 MemoryAllocator (kBundledAllocatorPoolSize , bundled_allocator_pool)};
200195 exec_aten::ArrayRef<void *> inputs;
201- if (FLAGS_bundled_program) {
202- // Use the inputs embedded in the bundled program.
203- status = torch::executor::util::LoadBundledInput (
204- *method,
205- file_data->data (),
206- &bundled_input_allocator,
207- 0 , // Using the 0th indexed program
208- FLAGS_testset_idx);
209- ET_CHECK_MSG (
210- status == Error::Ok,
211- " LoadBundledInput failed with status 0x%" PRIx32,
212- status);
213- } else {
214- // Use ones-initialized inputs.
215- inputs = torch::executor::util::PrepareInputTensors (*method);
216- }
196+ // Use the inputs embedded in the bundled program.
197+ status = torch::executor::util::LoadBundledInput (
198+ *method,
199+ file_data->data (),
200+ &bundled_input_allocator,
201+ 0 , // Using the 0th indexed program
202+ FLAGS_testset_idx);
203+ ET_CHECK_MSG (
204+ status == Error::Ok,
205+ " LoadBundledInput failed with status 0x%" PRIx32,
206+ status);
207+
217208 ET_LOG (Info, " Inputs prepared." );
218209
219210 // Run the model.
@@ -250,23 +241,20 @@ int main(int argc, char** argv) {
250241 }
251242
252243 // Handle the outputs.
253- if (FLAGS_bundled_program) {
254- status = torch::executor::util::VerifyResultWithBundledExpectedOutput (
255- *method,
256- file_data->data (),
257- &bundled_input_allocator,
258- 0 ,
259- FLAGS_testset_idx,
260- 1e-5 , // rtol
261- 1e-8 // atol
262- );
263- ET_CHECK_MSG (
264- status == Error::Ok,
265- " Bundle verification failed with status 0x%" PRIx32,
266- status);
267- ET_LOG (Info, " Model verified successfully." );
268- } else {
269- torch::executor::util::FreeInputs (inputs);
270- }
244+ status = torch::executor::util::VerifyResultWithBundledExpectedOutput (
245+ *method,
246+ file_data->data (),
247+ &bundled_input_allocator,
248+ 0 ,
249+ FLAGS_testset_idx,
250+ 1e-5 , // rtol
251+ 1e-8 // atol
252+ );
253+ ET_CHECK_MSG (
254+ status == Error::Ok,
255+ " Bundle verification failed with status 0x%" PRIx32,
256+ status);
257+ ET_LOG (Info, " Model verified successfully." );
258+
271259 return 0 ;
272260}
0 commit comments