PyTorch + Golang?

I’m aware that PyTorch 1.0 now supports deployment to C++ using tracing, etc. and there’s also ONNX for cross-framework deployments. I’m wondering if there’s any recommendation about running models in a production Golang API?

The only option I could think of would be PyTorch->ONNX->TensorFlow to use TF’s Go bindings, which seems like a very indirect path.

Any additional tips would be helpful!

4 Likes

at the moment that’s your best bet. Alternatively writing Go -> PyTorch C++ bindings for the functions you want, but that seems like it’ll be maintenance overhead for you.

2 Likes

Thanks Soumith! I hope that Go bindings (and generally more language bindings) might be on the roadmap for future PyTorch! :slight_smile:

4 Likes
3 Likes

Hey, do you have any update on it ?
What would be the best way to load a torch model in golang app ?
Thank you