# Export a Pytorch model to LiteRT

> 
> 
> The recommended approach to convert pytorch to Litert is:

PyTorch &gt; ONNX &gt; TensorFlow (SavedModel) &gt; LiteRT

## Export the Pytorch model to ONNX

import torch

    model.eval()
    dummy_input = torch.randn(1, 3, 224, 224)
    torch.onnx.export(model,
                      dummy_input,
                      "model.onnx",
                      opset_version=13,
                      input_names=["input"],
                      output_names=["output"],
                      do_constant_folding=True)
    Copy to clipboard

Once the model has been converted to ONNX, follow the instructions in [Export ONNX model to a LiteRT](https://docs.qualcomm.com/doc/80-80022-15B/topic/export-onnx-model-to-litert.html).

Last Published: May 14, 2026

[Previous Topic
Export ONNX model to a LiteRT](https://docs.qualcomm.com/bundle/publicresource/80-80022-15B/topics/export-onnx-model-to-litert.md) [Next Topic
Benchmark a LiteRT model](https://docs.qualcomm.com/bundle/publicresource/80-80022-15B/topics/benchmark-a-litert-model.md)