Skip to content

Commit 933f812

Browse files
authored
wasi-nn: fix the size of tensor->type (#4333)
* this enum is (@WitX tag u8) in witx * it seems that some wasm modules actually use non-zero padding and cause errors * it's a bad practice to use C enum for ABI description anyway
1 parent 769d16e commit 933f812

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/iwasm/libraries/wasi-nn/include/wasi_nn_types.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ typedef struct {
7979
// dimensions.
8080
tensor_dimensions *dimensions;
8181
// Describe the type of element in the tensor (e.g., f32).
82-
tensor_type type;
82+
uint8_t type;
83+
uint8_t _pad[3];
8384
// Contains the tensor data.
8485
tensor_data data;
8586
} tensor;

0 commit comments

Comments
 (0)