Skip to content

Commit 2059f16

Browse files
dzakharJaccovG
authored andcommitted
[EXAMPLES] use old convert function in postprocess to not stick to mem allocation
1 parent b430d91 commit 2059f16

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

examples/auxiliary/examples_aux.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,12 @@ test_status model_run_single_in(
4545
return TEST_NOT_ENOUGH_MEM;
4646
}
4747

48-
mli_tensor pred_tensor = *model_output;
49-
pred_tensor.data.mem.pf32 = pred_data;
50-
pred_tensor.data.capacity = output_elements * sizeof(float);
51-
pred_tensor.el_type = MLI_EL_FP_32;
52-
5348
// Data preprocessing and model inference
5449
preprocess(data_in, model_input);
5550
inference(inf_param);
5651

5752
// Check result
58-
if (MLI_STATUS_OK == mli_hlp_convert_tensor(model_output, &pred_tensor)) {
53+
if (MLI_STATUS_OK == mli_hlp_fx_tensor_to_float(model_output, pred_data, output_elements)) {
5954
ref_to_pred_output err;
6055
measure_err_vfloat(ref_out, pred_data, output_elements, &err);
6156
printf("Result Quality: S/N=%-10.1f (%-4.1f db)\n", err.ref_vec_length / err.noise_vec_length, err.ref_to_noise_snr);

0 commit comments

Comments
 (0)