fix: renaming files

This commit is contained in:
Ahmedounet 2022-06-14 17:05:52 +02:00
parent 3ebb850b3d
commit 0bbbb15ca7
3 changed files with 13 additions and 7 deletions

View File

@ -7,7 +7,7 @@
#include "wasm_export.h"
#include "lib_run_inference.hpp"
#include "wasi_nn_tensorflow.hpp"
/**
* @brief loader of tensorflow

View File

@ -1,4 +1,4 @@
#include "lib_run_inference.hpp"
#include "wasi_nn_tensorflow.hpp"
#include <tensorflow/lite/interpreter.h>
#include <tensorflow/lite/kernels/register.h>
@ -28,7 +28,7 @@ _load(graph_builder_array builder, graph_encoding encoding)
if (model == nullptr) {
printf("failure: null model \n");
return invalid_argument;
return missing_memory;
}
// Build the interpreter with the InterpreterBuilder.
@ -38,7 +38,7 @@ _load(graph_builder_array builder, graph_encoding encoding)
if (interpreter == nullptr) {
printf("failure: null interpreter \n");
return invalid_argument;
return missing_memory;
}
return success;
@ -49,8 +49,14 @@ _set_input(tensor input_tensor)
{
auto *input = interpreter->typed_input_tensor<float>(0);
if (input == nullptr) {
return missing_memory;
}
for (int i = 0; i < input_tensor.dimensions[0]; i++) {
input[i] = (float)input_tensor.data[i];
}
return success;
}
}

View File

@ -1,5 +1,5 @@
#ifndef LIB_RUN_INFERENCE_HPP
#define LIB_RUN_INFERENCE_HPP
#ifndef WASI_NN_TENSORFLOW_HPP
#define WASI_NN_TENSORFLOW_HPP
#include <stdio.h>