Просмотр исходного кода

wasi_nn_openvino.c: remove the tensor layout adjustment logic (#4308)

the logic in question seems like an attempt to work around
some application bugs.
my wild guess is that it was for classification-example.
cf. https://github.com/bytecodealliance/wasmtime/issues/10867
YAMAMOTO Takashi 7 месяцев назад
Родитель
Сommit
5478d267f4
1 измененных файлов с 0 добавлено и 16 удалено
  1. 0 16
      core/iwasm/libraries/wasi-nn/src/wasi_nn_openvino.c

+ 0 - 16
core/iwasm/libraries/wasi-nn/src/wasi_nn_openvino.c

@@ -308,17 +308,6 @@ set_input(void *ctx, graph_execution_context exec_ctx, uint32_t index,
         if (ret != success)
             goto fail;
 
-        /* NCHW -> NHWC */
-        if (wasi_nn_tensor->dimensions->size == 4 || ov_dims[1] == 3) {
-            /* N */
-            /* H */
-            ov_dims[1] = ov_dims[2];
-            /* W */
-            ov_dims[2] = ov_dims[3];
-            /* C */
-            ov_dims[3] = 3;
-        }
-
         CHECK_OV_STATUS(ov_shape_create(wasi_nn_tensor->dimensions->size,
                                         ov_dims, &input_shape),
                         ret);
@@ -354,11 +343,6 @@ set_input(void *ctx, graph_execution_context exec_ctx, uint32_t index,
         CHECK_OV_STATUS(ov_preprocess_input_tensor_info_set_from(
                             input_tensor_info, ov_ctx->input_tensor),
                         ret);
-        /* ! HAS TO BE NHWC. Match previous layout conversion */
-        CHECK_OV_STATUS(ov_layout_create("NHWC", &input_layout), ret);
-        CHECK_OV_STATUS(ov_preprocess_input_tensor_info_set_layout(
-                            input_tensor_info, input_layout),
-                        ret);
 
         /* add RESIZE */
         CHECK_OV_STATUS(ov_preprocess_input_info_get_preprocess_steps(