Stream: git-wasmtime

Topic: wasmtime / issue #4464 Wasi-NN examples with misaligned l...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 18 2022 at 15:14):

gusye1234 opened issue #4464:

First of all, thanks for the great implementation of Wasi-NN!
I found something misaligned while I tried to read the OpenVINO backend and the corresponding example.

In the example, we passed an image in form of a tensor with the shape (1, 3, 224, 224):
https://github.com/bytecodealliance/wasmtime/blob/3032e3fcfbb818dd567f85561fce7813f5979747/crates/wasi-nn/examples/classification-example/src/main.rs#L29-L33
However, in the OpenVINO backend, the layout of input is fixed to NHWC, which I believe means (Batch, Height, Width, Channel).
https://github.com/bytecodealliance/wasmtime/blob/3032e3fcfbb818dd567f85561fce7813f5979747/crates/wasi-nn/src/openvino.rs#L88

Does that mean the model will treat our input as an image with a height of 3 pixels, width of 224 pixels, and channel of 224 pixels? But why we can still get the correct prediction?

view this post on Zulip Wasmtime GitHub notifications bot (Jun 02 2025 at 00:24):

yamt commented on issue #4464:

But why we can still get the correct prediction?

i guess we can't.
see: https://github.com/bytecodealliance/wasmtime/issues/10867

(sorry, i haven't noticed this issue when i opened mine.)


Last updated: Dec 13 2025 at 19:03 UTC