diff --git a/src/runtime/asr_nn_api.c b/src/runtime/asr_nn_api.c index 42dadf6e52242..5191835ce8f15 100644 --- a/src/runtime/asr_nn_api.c +++ b/src/runtime/asr_nn_api.c @@ -69,9 +69,9 @@ ASR_NN_DLL int asr_nn_inference(asr_nn_handle handle, AsrNnInDesc* in, AsrNnOutD input.shape = in->shape; input.strides = NULL; input.byte_offset = 0; - asr_tvm_set_input(h->th, in->input_name, &input); + if (asr_tvm_set_input(h->th, in->input_name, &input) < 0) return -1; - asr_tvm_run(h->th); + if (asr_tvm_run(h->th) < 0) return -1; DLTensor output; output.data = out->data; @@ -81,7 +81,7 @@ ASR_NN_DLL int asr_nn_inference(asr_nn_handle handle, AsrNnInDesc* in, AsrNnOutD output.shape = out->shape; output.strides = NULL; output.byte_offset = 0; - asr_tvm_get_output(h->th, 0, &output); + if (asr_tvm_get_output(h->th, 0, &output) < 0) return -1; return 0; }