Instantly share code, notes, and snippets.

Embed
What would you like to do?
float GetForceFromTensorFlow(float distance)
{
var runner = session.GetRunner ();
runner.AddInput (
graph["shots_input"][0],
new float[1,1]{{distance}}
);
runner.Fetch (graph ["shots/BiasAdd"] [0]);
float[,] recurrent_tensor = runner.Run () [0].GetValue () as float[,];
var force = recurrent_tensor[0, 0] / 10;
Debug.Log(String.Format("{0}, {1}", distance, force));
return force;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment