Files
StarPilot/selfdrive/modeld/runners/tfmodel.h
T
George Hotz 54dfddd245 Cleanup simulator and add usage instructions (#1050)
* cleanup simulator files

* minor updates

* update readme

* keras runner builds

* hmm, still doesn't work

* keras runner works

* should work with python3 keras mod

* touchups

old-commit-hash: c50c718293
2020-02-04 19:46:57 -08:00

36 lines
724 B
C++

#ifndef TFMODEL_H
#define TFMODEL_H
#include <stdlib.h>
#include "runmodel.h"
struct TFState;
class TFModel : public RunModel {
public:
TFModel(const char *path, float *output, size_t output_size, int runtime);
~TFModel();
void addRecurrent(float *state, int state_size);
void addDesire(float *state, int state_size);
void execute(float *net_input_buf, int buf_size);
private:
int proc_pid;
float *output;
size_t output_size;
float *rnn_input_buf = NULL;
int rnn_state_size;
float *desire_input_buf = NULL;
int desire_state_size;
// pipe to communicate to keras subprocess
void pread(float *buf, int size);
void pwrite(float *buf, int size);
int pipein[2];
int pipeout[2];
};
#endif