mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-09-05 17:32:26 +00:00
wasi_nn_tensorflowlite.cpp: reject non-fp32 input earlier (#4388)
this backend assumes fp32 here and there. it's safer to reject unexpected inputs explicitly.
This commit is contained in:
parent
4bf799c3af
commit
db7714f0f5
|
@ -281,6 +281,11 @@ set_input(void *tflite_ctx, graph_execution_context ctx, uint32_t index,
|
|||
{
|
||||
TFLiteContext *tfl_ctx = (TFLiteContext *)tflite_ctx;
|
||||
|
||||
if (input_tensor->type != fp32) {
|
||||
NN_ERR_PRINTF("unsupported input tensor type %u", input_tensor->type);
|
||||
return runtime_error;
|
||||
}
|
||||
|
||||
wasi_nn_error res;
|
||||
if (success != (res = is_valid_graph_execution_context(tfl_ctx, ctx)))
|
||||
return res;
|
||||
|
|
Loading…
Reference in New Issue
Block a user