Skip to content

Commit 5478d26

Browse files
authored
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. bytecodealliance/wasmtime#10867
1 parent 3a087c4 commit 5478d26

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

core/iwasm/libraries/wasi-nn/src/wasi_nn_openvino.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -308,17 +308,6 @@ set_input(void *ctx, graph_execution_context exec_ctx, uint32_t index,
308308
if (ret != success)
309309
goto fail;
310310

311-
/* NCHW -> NHWC */
312-
if (wasi_nn_tensor->dimensions->size == 4 || ov_dims[1] == 3) {
313-
/* N */
314-
/* H */
315-
ov_dims[1] = ov_dims[2];
316-
/* W */
317-
ov_dims[2] = ov_dims[3];
318-
/* C */
319-
ov_dims[3] = 3;
320-
}
321-
322311
CHECK_OV_STATUS(ov_shape_create(wasi_nn_tensor->dimensions->size,
323312
ov_dims, &input_shape),
324313
ret);
@@ -354,11 +343,6 @@ set_input(void *ctx, graph_execution_context exec_ctx, uint32_t index,
354343
CHECK_OV_STATUS(ov_preprocess_input_tensor_info_set_from(
355344
input_tensor_info, ov_ctx->input_tensor),
356345
ret);
357-
/* ! HAS TO BE NHWC. Match previous layout conversion */
358-
CHECK_OV_STATUS(ov_layout_create("NHWC", &input_layout), ret);
359-
CHECK_OV_STATUS(ov_preprocess_input_tensor_info_set_layout(
360-
input_tensor_info, input_layout),
361-
ret);
362346

363347
/* add RESIZE */
364348
CHECK_OV_STATUS(ov_preprocess_input_info_get_preprocess_steps(

0 commit comments

Comments
 (0)