robocar-steering-tflite-edg.../vendor/github.com/mattn/go-tflite/tflite.go.h

25 lines
590 B
C
Raw Normal View History

2021-10-10 19:03:57 +00:00
#ifndef GO_TFLITE_H
#define GO_TFLITE_H
#define _GNU_SOURCE
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <tensorflow/lite/c/c_api.h>
extern void _go_error_reporter(void*, char*);
static void
_error_reporter(void *user_data, const char* format, va_list args) {
char *ptr;
if (asprintf(&ptr, format, args)) {}
_go_error_reporter(user_data, ptr);
free(ptr);
}
static void
_TfLiteInterpreterOptionsSetErrorReporter(TfLiteInterpreterOptions* options, void* user_data) {
TfLiteInterpreterOptionsSetErrorReporter(options, _error_reporter, user_data);
}
#endif