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
This commit is contained in:
YAMAMOTO Takashi 2025-06-12 10:34:14 +09:00 committed by GitHub
parent 3a087c4244
commit 5478d267f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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(