wasi-nn: fix tensor_data abi for wasi_ephemeral_nn (#4379)
it's "(list u8)" in the witx definition. the new definition matches both of our own host definition (struct tensor_wasm) and wasmtime. cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4352
This commit is contained in:
@ -266,7 +266,8 @@ set_input(char *options)
|
||||
wasi_ephemeral_nn_error nnret;
|
||||
wasi_ephemeral_nn_graph_execution_context c =
|
||||
map_get(&contexts, context_id);
|
||||
tensor.data = buf;
|
||||
tensor.data.buf = buf;
|
||||
tensor.data.size = sz;
|
||||
nnret = wasi_ephemeral_nn_set_input(c, idx, &tensor);
|
||||
unmap_file(buf, sz);
|
||||
if (nnret != wasi_ephemeral_nn_error_success) {
|
||||
|
||||
@ -147,7 +147,8 @@ main(int argc, char **argv)
|
||||
wasi_ephemeral_nn_tensor tensor = {
|
||||
.dimensions = { .buf = (uint32_t[]){1, 3, 224, 224,}, .size = 4, },
|
||||
.type = wasi_ephemeral_nn_type_fp32,
|
||||
.data = tensordata,
|
||||
.data.buf = tensordata,
|
||||
.data.size = tensordatasz,
|
||||
};
|
||||
nnret = wasi_ephemeral_nn_set_input(ctx, 0, &tensor);
|
||||
unmap_file(tensordata, tensordatasz);
|
||||
|
||||
Reference in New Issue
Block a user