Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions c/src/ml-api-inference-single.c
Original file line number Diff line number Diff line change
Expand Up @@ -1582,23 +1582,20 @@ _ml_single_invoke_internal (ml_single_h single,
single_h->invoking = TRUE;
status = __invoke (single_h, _in, _out, need_alloc);
ml_tensors_data_destroy (_in);
_in = NULL;
single_h->invoking = FALSE;
single_h->state = IDLE;

if (status != ML_ERROR_NONE) {
if (need_alloc)
ml_tensors_data_destroy (_out);
goto exit;
}

if (need_alloc)
if (status == ML_ERROR_NONE && need_alloc)
__process_output (single_h, _out);
}

exit:
if (status == ML_ERROR_NONE) {
if (need_alloc)
if (status == ML_ERROR_NONE && need_alloc) {
*output = _out;
} else if (need_alloc) {
/* Clean up allocated output on error */
ml_tensors_data_destroy (_out);
}

single_h->input = single_h->output = NULL;
Expand Down
Loading