From 9c5994dfe919d5928cd5ed5d7e5c88a2f5b4c3fe Mon Sep 17 00:00:00 2001 From: Zingo Andersen Date: Tue, 17 Sep 2024 08:07:52 -0700 Subject: [PATCH] Arm Backend: Generate input if not supplied in the non semihosting (#5308) Summary: This will generate fake input filled with 1 instead of no input if no input is supplied. Pull Request resolved: https://github.com/pytorch/executorch/pull/5308 Reviewed By: swolchok Differential Revision: D62645530 Pulled By: digantdesai fbshipit-source-id: fdb313dfee3413f87884ab6416af18e1ecf77a39 --- examples/arm/executor_runner/arm_executor_runner.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/arm/executor_runner/arm_executor_runner.cpp b/examples/arm/executor_runner/arm_executor_runner.cpp index 95f2623497..a4d04f6d5d 100644 --- a/examples/arm/executor_runner/arm_executor_runner.cpp +++ b/examples/arm/executor_runner/arm_executor_runner.cpp @@ -93,10 +93,12 @@ Result prepare_input_tensors( size_t num_inputs = method_meta.num_inputs(); size_t num_allocated = 0; +#ifdef SEMIHOSTING ET_CHECK_OR_RETURN_ERROR( input_buffers.size() > 0 && num_inputs == input_buffers.size(), InvalidArgument, "Wrong number of inputs allocated compared to method"); +#endif void** inputs = static_cast(allocator.allocate(num_inputs * sizeof(void*)));