# 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.

Last Published: May 14, 2026

Previous Topic
 
Export ONNX model to a LiteRT Next Topic

Benchmark a LiteRT model