Making a pointer version of network_predict for python.

The python binding requires the network struct to be passed
as a pointer to it rather than a struct copy.
This commit is contained in:
John Aughey
2019-02-05 11:35:45 -06:00
parent 8726d7b0db
commit 7e9416aa80
3 changed files with 8 additions and 1 deletions

View File

@ -556,6 +556,12 @@ void top_predictions(network net, int k, int *index)
top_k(out, size, k, index);
}
// A version of network_predict that uses a pointer for the network
// struct to make the python binding work properly.
float *network_predict_ptr(network *net, float *input)
{
return network_predict(*net, input);
}
float *network_predict(network net, float *input)
{