File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/cpp_dl_benchmark/executorch_launcher/include Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -71,14 +71,23 @@ class LowLevelInferenceAPI : public InferenceAPI {
7171
7272 void set_input (const std::vector<std::vector<executorch::runtime::EValue>>& tens, const int input_idx) override {
7373 Error set_input_error = method.get ()->get ().set_input (tens[0 ][input_idx], 0 );
74+ if (set_input_error != Error::Ok) {
75+ throw std::runtime_error (" Error when setting input tensor." );
76+ }
7477 }
7578
7679 void inference () override {
7780 Error execute_error = method.get ()->get ().execute ();
81+ if (execute_error != Error::Ok) {
82+ throw std::runtime_error (" Inference error." );
83+ }
7884 }
7985
8086 const Tensor dump_output (const std::vector<std::vector<executorch::runtime::EValue>>& tens) override {
8187 Error set_input_error = method.get ()->get ().set_input (tens[0 ][0 ], 0 );
88+ if (set_input_error != Error::Ok) {
89+ throw std::runtime_error (" Error when setting input tensor." );
90+ }
8291 method.get ()->get ().execute ();
8392 const auto result = method.get ()->get ().get_output (0 );
8493 return result.toTensor ();
You can’t perform that action at this time.
0 commit comments