Skip to content

Commit

Permalink
[RUNTIME] check set_input/run/get_output return value
Browse files Browse the repository at this point in the history
Signed-off-by: Taikang Hu <[email protected]>
  • Loading branch information
Taikang Hu committed May 22, 2020
1 parent fdeac05 commit d8c5ed8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/runtime/asr_nn_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit d8c5ed8

Please sign in to comment.