pytorch/export
Export a PyTorch model to .pte format for ExecuTorch. Use when converting models, lowering to edge, or generating .pte files.
npx skills add https://github.com/pytorch/executorch --skill export
from executorch.exir import to_edge_transform_and_lower
from torch.export import export
exported = export(model.eval(), example_inputs)
edge = to_edge_transform_and_lower(exported)
with open("model.pte", "wb") as f:
f.write(edge.to_executorch().buffer)
| Model | Script |
|-------|--------|
| Llama | examples/models/llama/export_llama.py |
| Whisper | examples/models/whisper/ |
| Parakeet | examples/models/parakeet/export_parakeet_tdt.py |
export(model, inputs, strict=False)TORCH_LOGS="+dynamo,+export" python script.py 2>&1 | tlparsetorch.export.export(), dynamic shapes, strict mode, debuggingTake pytorch/export from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.