Fix compilation warnings of wasi-nn (#3497)
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
error
|
||||
wasi_nn_error
|
||||
wasm_load(char *model_name, graph *g, execution_target target)
|
||||
{
|
||||
FILE *pFile = fopen(model_name, "r");
|
||||
@ -46,7 +46,7 @@ wasm_load(char *model_name, graph *g, execution_target target)
|
||||
arr.buf[0].size = result;
|
||||
arr.buf[0].buf = buffer;
|
||||
|
||||
error res = load(&arr, tensorflowlite, target, g);
|
||||
wasi_nn_error res = load(&arr, tensorflowlite, target, g);
|
||||
|
||||
fclose(pFile);
|
||||
free(buffer);
|
||||
@ -54,13 +54,13 @@ wasm_load(char *model_name, graph *g, execution_target target)
|
||||
return res;
|
||||
}
|
||||
|
||||
error
|
||||
wasi_nn_error
|
||||
wasm_init_execution_context(graph g, graph_execution_context *ctx)
|
||||
{
|
||||
return init_execution_context(g, ctx);
|
||||
}
|
||||
|
||||
error
|
||||
wasi_nn_error
|
||||
wasm_set_input(graph_execution_context ctx, float *input_tensor, uint32_t *dim)
|
||||
{
|
||||
tensor_dimensions dims;
|
||||
@ -75,19 +75,19 @@ wasm_set_input(graph_execution_context ctx, float *input_tensor, uint32_t *dim)
|
||||
tensor.dimensions->buf[i] = dim[i];
|
||||
tensor.type = fp32;
|
||||
tensor.data = (uint8_t *)input_tensor;
|
||||
error err = set_input(ctx, 0, &tensor);
|
||||
wasi_nn_error err = set_input(ctx, 0, &tensor);
|
||||
|
||||
free(dims.buf);
|
||||
return err;
|
||||
}
|
||||
|
||||
error
|
||||
wasi_nn_error
|
||||
wasm_compute(graph_execution_context ctx)
|
||||
{
|
||||
return compute(ctx);
|
||||
}
|
||||
|
||||
error
|
||||
wasi_nn_error
|
||||
wasm_get_output(graph_execution_context ctx, uint32_t index, float *out_tensor,
|
||||
uint32_t *out_size)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user