# How to deploy pytorch model using C++

**URL:** <https://discuss.tvm.apache.org/t/how-to-deploy-pytorch-model-using-c/17978>\
**Category:** Application\
**Created:** [January 1, 2025, 1:48am UTC](https://discuss.tvm.apache.org/t/how-to-deploy-pytorch-model-using-c/17978 "2025-01-01T01:48:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RajS999](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/rajs999/32/5702_2.png) [@RajS999](https://discuss.tvm.apache.org/u/RajS999)\
**Post date:** [January 1, 2025, 1:48am UTC](https://discuss.tvm.apache.org/t/how-to-deploy-pytorch-model-using-c/17978/1 "2025-01-01T01:48:54Z")

</div>

I have trained a pytorch model. I want to use it for inference on MIPS platform running embedded OS based on Linux. I am struggling to find necessary steps in Apache TVM docs. Here is what I have done so far:

1. Translate pytorch model to TorchScript model as explained [here](https://tvm.apache.org/docs/how_to/compile_models/from_pytorch.html#load-a-pretrained-pytorch-model)
2. Cross compiled TVM runtime for my MIPS platform as explained [here](https://tvm.apache.org/docs/how_to/deploy/index.html#cross-compile-for-risc-v).

However I am unable to find any further steps.

My target platform does not run python, but only C/C++. Does the documentation contain any example / tutorial that explain how can I deploy pytorch model using C++?

---

<div class="post-metadata">

**Author:** ![AQSingh](https://discuss.tvm.apache.org/user_avatar/discuss.tvm.apache.org/aqsingh/32/4666_2.png) [@AQSingh](https://discuss.tvm.apache.org/u/AQSingh)\
**Post date:** [January 2, 2025, 6:03pm UTC](https://discuss.tvm.apache.org/t/how-to-deploy-pytorch-model-using-c/17978/2 "2025-01-02T18:03:15Z")

</div>

Perhaps refer to this document?

[https://tvm.apache.org/docs/how\_to/deploy/cpp\_deploy.html](https://tvm.apache.org/docs/how_to/deploy/cpp_deploy.html)

It should be possible to run inference in your language of choice without the need for Python.
