mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-07-15 08:48:33 +00:00
fix: renaming files
This commit is contained in:
parent
3ebb850b3d
commit
0bbbb15ca7
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include "wasm_export.h"
|
#include "wasm_export.h"
|
||||||
|
|
||||||
#include "lib_run_inference.hpp"
|
#include "wasi_nn_tensorflow.hpp"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief loader of tensorflow
|
* @brief loader of tensorflow
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#include "lib_run_inference.hpp"
|
#include "wasi_nn_tensorflow.hpp"
|
||||||
|
|
||||||
#include <tensorflow/lite/interpreter.h>
|
#include <tensorflow/lite/interpreter.h>
|
||||||
#include <tensorflow/lite/kernels/register.h>
|
#include <tensorflow/lite/kernels/register.h>
|
||||||
|
@ -28,7 +28,7 @@ _load(graph_builder_array builder, graph_encoding encoding)
|
||||||
|
|
||||||
if (model == nullptr) {
|
if (model == nullptr) {
|
||||||
printf("failure: null model \n");
|
printf("failure: null model \n");
|
||||||
return invalid_argument;
|
return missing_memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Build the interpreter with the InterpreterBuilder.
|
// Build the interpreter with the InterpreterBuilder.
|
||||||
|
@ -38,7 +38,7 @@ _load(graph_builder_array builder, graph_encoding encoding)
|
||||||
|
|
||||||
if (interpreter == nullptr) {
|
if (interpreter == nullptr) {
|
||||||
printf("failure: null interpreter \n");
|
printf("failure: null interpreter \n");
|
||||||
return invalid_argument;
|
return missing_memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
|
@ -49,8 +49,14 @@ _set_input(tensor input_tensor)
|
||||||
{
|
{
|
||||||
auto *input = interpreter->typed_input_tensor<float>(0);
|
auto *input = interpreter->typed_input_tensor<float>(0);
|
||||||
|
|
||||||
|
if (input == nullptr) {
|
||||||
|
return missing_memory;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < input_tensor.dimensions[0]; i++) {
|
for (int i = 0; i < input_tensor.dimensions[0]; i++) {
|
||||||
input[i] = (float)input_tensor.data[i];
|
input[i] = (float)input_tensor.data[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
return success;
|
return success;
|
||||||
}
|
|
||||||
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
#ifndef LIB_RUN_INFERENCE_HPP
|
#ifndef WASI_NN_TENSORFLOW_HPP
|
||||||
#define LIB_RUN_INFERENCE_HPP
|
#define WASI_NN_TENSORFLOW_HPP
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user